2016-11-19 5 views
1

私はlaravelでリポジトリに新しいですし、その上で動作するようにしようとしますが、私は、アプリケーションを実行すると、エラーリポジトリを使用しているときにサービスプロバイダクラスが見つかりませんでしたか?

クラス「のApp \リポジトリ\ユーザー\のUserRepoServiceProviderは」

マイインタフェースが見つかりませんスローそして、リポジトリファイルはアプリの\リポジトリ\に配置されているサービスプロバイダはまた、ここで

に位置しているユーザーは、自分のサービスプロバイダである

namespace App\Repositories\User 

use Illuminate\Support\ServiceProvider; 

class UserRepoServiceProvider extends ServiceProvider 

{ 

public function register() 
{ 

$this->app->bind('App\Repositories\User\userinterface','App\Repositories \User\userrepository'); 
} 
} 

ここここ

namespace App\Repositories\User 

use App\Repositories\User\userinterface; 
use App\car; 

class userrepository implements userinterface 
{ 

public function __construct(car $car){ 

$this->car = $car; 
} 

public function get($id) 
{ 

return $this->car->findCar($id); 
} 

public function delete($id) 
{ 

return $this->car->deleteCar($id); 
} 


} 

namespace App\Repositories\User; 

interface userinterface{ 

public function get($id); 

public function delete($id); 
} 

私も設定でそれを登録したuserinterface.php私のインターフェイス/ app.phpファイル

のApp \リポジトリ\ユーザーである私のuserrepository.phpです\ UserRepoServiceProvider :: class

私は作者dump-autoload -oを使いましたが、使用しませんでした。私はコンポーザーアップデートを行うことができません。同じエラーが発生した場合

+0

キャッシュされたファイルを削除してみてください。 'rm bootstrap/cache/*'を実行します。次に、コンポーザーのインストールをもう一度実行します。 – alariva

+0

アプリケーションにどのような変更が加えられるのか分かりますか? –

+0

もちろん、最初に 'ls'を実行すると、どのファイルを削除するかを知ることができます。これらはキャッシュされたバージョンであり、期限が切れている可能性があります。 Plust、それは実際にあなたのアプリの動作を変更しません。必要に応じて自動的に再生成されます。疑わしい場合は、まずファイルをバックアップしてください。 – alariva

答えて

関連する問題