api-guard icon indicating copy to clipboard operation
api-guard copied to clipboard

adding to $routeMiddleware in Laravel 5.2

Open tiny-village-lab opened this issue 9 years ago • 2 comments

Hi Chris,

Just a little precision in your doc :

instead of

protected $routeMiddleware = [
    ...
    'apiguard' => Chrisbjr\ApiGuard\Http\Middleware\ApiGuard::class,
];

I had to use :

protected $routeMiddleware = [
    ...
    'apiguard' => \Chrisbjr\ApiGuard\Http\Middleware\ApiGuard::class,
];

Or it returns me a reflection error in Container.php.

Do you see what i mean ?

tiny-village-lab avatar Apr 20 '16 14:04 tiny-village-lab

I have the same error, Can you help me please?

I am using ApiGuard in a Laravel 5.2 project, I followed the instalation guide but I get: ReflectionException in Container.php line 738: Class App\Http\Chrisbjr\ApiGuard\Http\Middleware\ApiGuard does not exist

carlos727 avatar Apr 24 '16 21:04 carlos727

I had the same problem, inconsistent use of \Chrisbjr probably due to classes being in new namespaces in Laravel v5 vs v4.

malhal avatar May 14 '16 22:05 malhal