Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L5.2 upgrade #87

Closed
ddimaria opened this issue Jan 27, 2016 · 3 comments
Closed

L5.2 upgrade #87

ddimaria opened this issue Jan 27, 2016 · 3 comments

Comments

@ddimaria
Copy link

Hi, I just upgraded to L5.2 and pulled the latest apiguard from dev-master. I'm getting this error: Class apiguard does not exist. Anyone else getting this?

@ddimaria
Copy link
Author

I was able to get past this by adding \Chrisbjr\ApiGuard\Http\Middleware\ApiGuard::class to the $middleware in App\Http\Kernel.php

The next issue is related to the \Chrisbjr\ApiGuard\Http\Middleware\ApiGuard::handle() method, which has 3 params. That 3 param is never getting passed.

@ddimaria
Copy link
Author

Resolved this by moving the middleware to the $routeMiddleware attribute:

protected $routeMiddleware = [ 'auth' => 'App\Http\Middleware\Authenticate', 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', 'guest' => 'App\Http\Middleware\RedirectIfAuthenticated', 'apiguard' => \Chrisbjr\ApiGuard\Http\Middleware\ApiGuard::class, ];

So, all good, just need to update the docs for the middleware implementation (branch?)

@muya
Copy link

muya commented Jan 29, 2016

I wrote up a small guide to help with upgrading https://blog.muya.co.ke/api-guard-laravel-5-2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants