andersao / andersao/l5-repository

BindingResolutionException

未關閉
#351 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
PHP
星號
4.2k
分支
880
PR 合併指標
30 天內沒有已合併 PR

描述

I have installed and configured everything.

When i am trying to create Route with Controller / any Class method, i have got this error
`Illuminate \ Contracts \ Container \ BindingResolutionException
Target [App\Repositories\SubscriptionRepository] is not instantiable while building [App\Http\Controllers\SubscriptionsController].
...
throw new BindingResolutionException($message);
...`

**Routes**
`
```
// this works
Route::get('/test', function(){
return view('test_view');
});

// and this one is NOT
Route::get('test', 'TestsController@test'); // here we return our test_view
```
1 - this causes memory leak -> App\Providers\AppRepositoryProvider in app.php
2 - composer update
3 - composer dumautoload
4 - php artisan clear-compiled
5 - php artisan chache:clear
6 - checked binding, i am not pro, but it seems to be ok
`$this->app->bind(\App\Repositories\TestRepository::class, \App\Repositories\TestRepositoryEloquent::class);`

Also, in Laravel 5.4 was changed Trait name.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。