B
B
BonBon Slick2017-03-03 12:20:15
Laravel
BonBon Slick, 2017-03-03 12:20:15

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"
  },

I installed and configured them, although I don’t understand what they do at all. Now I can’t create any Route at all, it gives an error:
Route [home] not defined. // или любой другой
It also knocks out
Illuminate \ Contracts \ Container \ BindingResolutionException
Target [App\Repositories\UserRepository] is not instantiable while building [App\Http\Controllers\UsersController].

...
 throw new BindingResolutionException($message);
...

view files exist, the route is correct, the controller is correct too. If you write in the controller return '123'; it will return, but on the view it gives this error.
Although if I write the php artisan make:auth command, the /home route will work for 5-10 minutes, and then it also gives this error.
What's happening? What kind of package is this? How to fix?
Addition: a little (hours) digging:
//работает 
  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...')...

Tried:
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

I can't see the list of routes:
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

2 answer(s)
B
BonBon Slick, 2017-03-03
@BonBonSlick

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 question

Ask a Question

731 491 924 answers to any question