ollieread/multiauth

Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable.

rajanrawal opened this issue · 22 comments

Laravel 5.1.16

php artisan clear compiled

composer updated

composer dump-autoload -o

All tried but getting

App crashing. Throwing error:

BindingResolutionException in Container.php line 744: 
Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable.

Something is trying to instantiate the Gate interface. I'll check through the code but it may be worth checking your own to see what's going on.

Assuming that you're using the Laravel 5 branch, I've searched the entire codebase for the term gate, the only time it appears, ever, is in a comment that actually says aggregate.

@ollieread I am really sorry. Yes I am using 5.1.16. I enjoyed you package for 4.2 a lot. But there is nothing out there for laravel >= 5.1.11 + which work nice as yours was!

I have the same problem...
Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable.
Using Laravel 5.1

Can one of you post a stacktrace so that I can exactly what's going on?

Have you added Gate as an alias to ./config/app.php?

'Gate'      => 'Illuminate\Support\Facades\Gate',

You may also want to run rm -rf bootstrap/cache/* and also composer du.

Yes of course we did it. Though it was not working.

On Wed, Sep 16, 2015 at 1:06 PM, James Brooks notifications@github.com
wrote:

Have you added Gate as an alias to ./config/app.php?

'Gate' => 'Illuminate\Support\Facades\Gate',


Reply to this email directly or view it on GitHub
#107 (comment)
.

Intensity works... Always...

Thank You & Regards,
Rajan Y. Rawal
+91 903 315 5300

What about the last two bits I suggested?

No workout.

Here is the stacktrace

BindingResolutionException in Container.php line 744: Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable. in Container.php line 744 at Container->build('Illuminate\Contracts\Auth\Access\Gate', array()) in Container.php line 626 at Container->make('Illuminate\Contracts\Auth\Access\Gate', array()) in Application.php line 674 at Application->make('Illuminate\Contracts\Auth\Access\Gate') in Container.php line 572 at Container->addDependencyForCallParameter(object(ReflectionParameter), array(), array()) in Container.php line 532 at Container->getMethodDependencies(array(object(AuthServiceProvider), 'boot'), array()) in Container.php line 500 at Container->call(array(object(AuthServiceProvider), 'boot')) in Application.php line 734 at Application->bootProvider(object(AuthServiceProvider)) in Application.php line 717 at Application->Illuminate\Foundation\{closure}(object(AuthServiceProvider), '14') at array_walk(array(object(EventServiceProvider), object(RoutingServiceProvider), object(ControllerServiceProvider), object(CookieServiceProvider), object(DatabaseServiceProvider), object(EncryptionServiceProvider), object(FilesystemServiceProvider), object(FormRequestServiceProvider), object(FoundationServiceProvider), object(PaginationServiceProvider), object(SessionServiceProvider), object(ValidationServiceProvider), object(ViewServiceProvider), object(AppServiceProvider), object(AuthServiceProvider), object(EventServiceProvider), object(RouteServiceProvider), object(MultiauthServiceProvider), object(SluggableServiceProvider)), object(Closure)) in Application.php line 718 at Application->boot() in BootProviders.php line 17 at BootProviders->bootstrap(object(Application)) in Application.php line 203 at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 222 at Kernel->bootstrap() in Kernel.php line 117 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87 at Kernel->handle(object(Request)) in index.php line 54

Have you ran composer update before adding the alias?

Yes all done, basically there is forum question that one asked on laravel forum and the steps you said were mentioned there

https://laracasts.com/discuss/channels/laravel/l51-unable-to-fetch-the-gate-facade-through-composer?page=0

I already suggested deleting everything in bootstrap/cache ;)

So this isn't a multiauth issue?

No, I'm pretty sure that it's not.

Ahh excellent, I couldn't recreate this anyway!

@jbrooksuk dude what laravel version you are using? Are you on 5.1.16? The latest one?

@ollieread of course even we want to close it if there is not bug, but let test it once. @jbrooksuk I cleaned bootstrap cache as well. Its same here still

@rajanrawal Yeah, the latest.

I tested everything as it was informed here, its still not working at all and throwing the same error. Anyway thank you.

I'm having the same error as @rajanrawal. I'm currently using the version 5.1.17 of Laravel.

php artisan --version
Laravel Framework version 5.1.17 (LTS)

I added sboo/multiauth to composer.json :

"sboo/multiauth" : "4.0.*"

Then I launched composer update command. sboo/multiauth v4.0.9 is installed successfully and everything is going fine, no error at this moment. After that, I ran composer du.

But when I replace ''Illuminate\Auth\AuthServiceProvider' by 'Ollieread\Multiauth\MultiauthServiceProvider' and 'Illuminate\Auth\Passwords\PasswordResetServiceProvider' by 'Ollieread\Multiauth\Passwords\PasswordResetServiceProvider', I'm getting this error :

BindingResolutionException in Container.php line 744:
Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable.

As I read on differents issues, I cleared cache by deletting boostrap/cache/* folder by still having the error. Am I doing something wrong ?

@Schnapse Some how issue has been closed. Don't know why? I am still stuck with that too. Then i got it worked with https://github.com/Kbwebs/MultiAuth so for now using that. You can try that.

@rajanrawal Thanks for your reply, Kbwebs version is working fine.