samedi 26 septembre 2015

Issue with middleware "Maximum function nesting level of '100' reached, aborting!"

I had a controller, lets call it DummyController, that performs CRUD operations in the root of controllers folder. I have moved dummy controller into a different directory, a level higher, so our DummyController is now in folder named 'r'.

Due to that I have updated the edit form, which is used with dummy controller:

{!! Form::model($message, ['method' => 'PATCH', 'action' => ['r\DummyController@update', $message->id]]) !!} 

And now it's broken. I have tried playing around with controller and narrowed the issue down to middleware that I use in Dummy Controller. I have 'auth' middleware and my own 'role' middleware:

if (Auth::user()->role_id != config('Roles.admin')) {
            return redirect('/');
        }

If I remove one middleware everything starts working, I cant have both running, which is strange because before it worked fine.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1jl6fMI
via IFTTT

Aucun commentaire:

Enregistrer un commentaire