Answer the question
In order to leave comments, you need to log in
Route [{$name}] not defined?
They gave me the task to register and subscribe via stripe with this set of plugins:
"require": {
"php": ">=5.6.4",
"bugsnag/bugsnag-laravel": "^2.0",
"intervention/image": "^2.3",
"laravel/cashier": "~7.0",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"lord/laroute": "2.*",
"orangehill/iseed": "dev-master",
"prettus/l5-repository": "^2.6", // скорее всего, этот плагин вызывает ошибку.
"yajra/laravel-datatables-oracle": "^7.3"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7",
"filp/whoops": "^2.1",
"barryvdh/laravel-debugbar": "^2.3",
"barryvdh/laravel-ide-helper": "^2.2"
},
Route [home] not defined. // или любой другой
Illuminate \ Contracts \ Container \ BindingResolutionException
Target [App\Repositories\UserRepository] is not instantiable while building [App\Http\Controllers\UsersController].
...
throw new BindingResolutionException($message);
...
//работает
Route::get('/123', function(){
return view('front.subscription.subscribe');
});
// выдает ошибку
Route::get('/123', '[email protected]');
// ОШибка
Illuminate \ Contracts \ Container \ BindingResolutionException
Target [App\Repositories\SubscriptionRepository] is not instantiable while building [App\Http\Controllers\SubscriptionsController].
...
throw new BindingResolutionException($message);
...
// Log file
Illuminate\Contracts\Container\BindingResolutionException: Target [App\Repositories\TestRepository] is not instantiable while building [App\Http\Controllers\TestsController]. in C:\Users\BonBonS\Desktop\OpenServer\domains\project\vendor\laravel\framework\src\Illuminate\Container\Container.php:804
Stack trace:
#0 C:\Users\BonBonS\Desktop\OpenServer\domains\project\vendor\laravel\framework\src\Illuminate\Container\Container.php(687): Illuminate\Container\Container->notInstantiable('App\\Repositorie...')...
1 - регистрировал в провайдерах App\Providers\RepositoryServiceProvider::class в app.php
2 - composer update
3 - composer dumautoload
4 - php artisan clear-compiled
5 - php artisan chache:clear
6 - php artisan optimize
php artisan route:list
[Illuminate\Contracts\Container\BindingResolutionException]
Target [App\Repositories\TestRepository] is not instantiable while building
[App\Http\Controllers\TestsController].
Answer the question
In order to leave comments, you need to log in
The solution turned out to be stupid to disgrace:
1 - replace AppNamespaceDetectorTrait with DetectsApplicationNamespace
2 - add to app.php -> providers -> App \Providers\RepositoryServiceProvider::class
instead of Prettus \Repository\Providers\RepositoryServiceProvider::class as indicated in the package proof!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question