LaravelRUS / SleepingOwlAdmin

🦉 Administrative interface builder for Laravel (Laravel admin)
http://sleepingowladmin.ru/
MIT License
805 stars 217 forks source link

BindingResolutionException in Container.php line 763 #307

Closed FubuBy closed 8 years ago

FubuBy commented 8 years ago

Обновил для текущего проекта версию laravel c 5.2 до 5.3. В итоге получаю такую ошибку ("laravelrus/sleepingowl": "4.*@dev",):

BindingResolutionException in Container.php line 763:
Target [SleepingOwl\Admin\Contracts\ModelConfigurationInterface] is not instantiable.
in Container.php line 763
at Container->build('SleepingOwl\Admin\Contracts\ModelConfigurationInterface', array()) in Container.php line 644
at Container->make('SleepingOwl\Admin\Contracts\ModelConfigurationInterface', array()) in Application.php line 709
at Application->make('SleepingOwl\Admin\Contracts\ModelConfigurationInterface') in RouteDependencyResolverTrait.php line 85
at ControllerDispatcher->transformDependency(object(ReflectionParameter), array('adminModel' => 'cities'), array('adminModel' => 'cities')) in RouteDependencyResolverTrait.php line 57
at ControllerDispatcher->resolveMethodDependencies(array('adminModel' => 'cities'), object(ReflectionMethod)) in RouteDependencyResolverTrait.php line 41
at ControllerDispatcher->resolveClassMethodDependencies(array('adminModel' => 'cities'), object(AdminController), 'getDisplay') in ControllerDispatcher.php line 40
at ControllerDispatcher->dispatch(object(Route), object(AdminController), 'getDisplay') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 642
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 28
at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 644
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 618
at Router->dispatchToRoute(object(Request)) in Router.php line 596
at Router->dispatch(object(Request)) in Kernel.php line 267
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 53

Как можно решить эту проблему?

uacode commented 8 years ago

Вот вот, господа я тоже два раза переинсталивал пробовал через секци делать и те же яйца, в итоге пока что пришлось подзабить :(

Жду решения!

xcaptain commented 8 years ago

+1 the same problem, so I'm still using 5.2

butschster commented 8 years ago

Просьба проверить наличие middleware https://github.com/laravel/laravel/blob/5.3/app/Http/Kernel.php#L32 в Http\Kernel.php

FubuBy commented 8 years ago

@butschster помогло, спасибо

ngame2011 commented 8 years ago

@butschster не помогло, есть еще варианты? Laravel 5.3 sleepingowl 4.*@dev

butschster commented 8 years ago

@ngame2011 ошибка один в один?

ngame2011 commented 8 years ago

Да, BindingResolutionException in Container.php line 763: Target [SleepingOwl\Admin\Contracts\ModelConfigurationInterface] is not instantiable. Причем она проявляется только при сохранении форм.

butschster commented 8 years ago

@ngame2011 приложи весь листинг

ngame2011 commented 8 years ago
uacode commented 8 years ago

Все работает, можно закрывать тикет

butschster commented 7 years ago

See https://github.com/LaravelRUS/SleepingOwlAdmin/issues/307#issuecomment-252845653

nesymno commented 7 years ago

Laravel 5.3 - аналогичная ошибка. Middleware на месте. Что это еще может быть?


BindingResolutionException in Container.php line 763:
Target [SleepingOwl\Admin\Contracts\ModelConfigurationInterface] is not instantiable.
in Container.php line 763
at Container->build('SleepingOwl\Admin\Contracts\ModelConfigurationInterface', array()) in Container.php line 644
at Container->make('SleepingOwl\Admin\Contracts\ModelConfigurationInterface', array()) in Application.php line 709
at Application->make('SleepingOwl\Admin\Contracts\ModelConfigurationInterface') in RouteDependencyResolverTrait.php line 85
at ControllerDispatcher->transformDependency(object(ReflectionParameter), array('adminModel' => 'users'), array('adminModel' => 'users')) in RouteDependencyResolverTrait.php line 57
at ControllerDispatcher->resolveMethodDependencies(array('adminModel' => 'users'), object(ReflectionMethod)) in RouteDependencyResolverTrait.php line 41
at ControllerDispatcher->resolveClassMethodDependencies(array('adminModel' => 'users'), object(AdminController), 'getDisplay') in ControllerDispatcher.php line 40
at ControllerDispatcher->dispatch(object(Route), object(AdminController), 'getDisplay') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 653
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 655
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 53
butschster commented 7 years ago

@Vuishnak Я бы проверил наличие роута web в конфиге sleeping_owl, причем чтобы он стоял до auth

nesymno commented 7 years ago

Помогло, спасибо! Но это довольно странно, ведь в 5.3 laravel сам добавляет middleware web для всех роутов... И в документации (вашей) написано, что если версия больше 5.1, то можно убрать 'web'

butschster commented 7 years ago

@Vuishnak В 5.3 в web добавили этот middleware. Покажи, Где в документации написано, что web ко всем роутам добавляется.

nesymno commented 7 years ago

@butschster мои извинения, не правильно прочел. Там 5.1 и ниже...

ivi1974 commented 7 years ago

Laravel 5.4 . Чистый проект, получаю такую же ошибку. Middleware на месте.

Butochnikov commented 7 years ago

@YarsVP куча проектов на 5.3 и 5.4. Проверяй все внимательно. https://sleepingowladmin.ru/docs/installation

p.s.: только что установил на чистый laravel 5.4, все работает.

stoyat commented 6 years ago

Laravel 5.5 ошибка - Target [SleepingOwl\Admin\Contracts\ModelConfigurationInterface] is not instantiable. middleware все норм. Что может быть?

arsensokolov commented 6 years ago

Laravel 5.6 такая же ошибка, не знаю где решение. Что может быть?

romicaiarca commented 4 years ago

For this issue, the solution for me was: I looked in in file config/sleeping_owl.php for entry 'middleware'. Here I had ['admin_auth'].

'middleware' => ['admin_auth'],

Looks like SO needs the web entry too here, even if you didn't define any middleware for this. So it should look like this:

'middleware' => ['admin_auth', 'web'],