サービスプロパイダーを登録するとエラーになる
○サービスプロパイダーを登録するとエラーになる
コマンドでサービスプロパイダーを作って
php artisan workbench futari/rei --resources
app/config.phpにサービスプロパイダーを追記すると
'providers' => array( 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Cache\CacheServiceProvider', <中略> 'Futari\Ruser\RuserServiceProvider', ),
サービスプロパイダーが見つからないというエラーが出る。
>php artisan dump-autoload {"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Futari\\Rei\\ReiServiceProvider' not found","file":"C:\\xam pp\\futari\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\ProviderRepository.php","line":158}}{"error":{"type":"Symfony\\Component\\Debug\\Exception\ \FatalErrorException","message":"Class 'Futari\\Rei\\ReiServiceProvider' not found","file":"C:\\xampp\\futari\\vendor\\laravel\\framework\\src\\Illuminate \\Foundation\\ProviderRepository.php","line":158}}
理由はさっぱりわからないけど、見つからないサービスプロパイダーのフォルダの中に入ってからdump-autol
oadすると解決した。
C:\xampp\futari\workbench\Futari\Rei>php "C:\xampp\futari\artisan" dump-autoload Generating optimized class loader Running for workbench [Futari\Rei]...