I started a project on Laravel 5.4 today and got a ServiceProvider problem. Here my service provider :
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class WizamProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//die('YESSS');
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->bind('Wizam\Test', function()
{
if(class_exists("Domains\Domomat\Test"))
return new \Domains\Domomat\Test;
else
return new \Core\Classes\Test;
});
}
}
I added this provider into config/app.php (App\Providers\WizamProvider::class
), dump my autoloader like twenty times, clear cache, clear config. Nothing happened.
Here my route :
Route::get('/sub', function()
{
$test = new \Wizam\Test();
echo $test->render();
});
When I go to '/sub', I got Class 'Wizam\Test' not found
. I cannot see my error, can you help me ?
Thanks !