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

Can't see BeforeFilter() when using Route::resource with filters in __construct #7

Closed
ErikVermeij7T opened this issue Sep 27, 2013 · 3 comments

Comments

@ErikVermeij7T
Copy link

Thanks, barryvdh.

I'm using your debugbar when developing my site. It's a nice piece of code and very handy.

But enough chitchat, here's the issue. I'm using a Controller and added it to my Routes.php like so:

Route::resource('dashboard/gebruikers', 'GebruikersController');

In the controller i have a __construct function like so:

public function __construct()
{
    $this->beforeFilter('dashboard');
    $this->beforeFilter('csrf', array('on' => array('put','post')));
}    

But now i don't see the BeforeFilter() in tab Route from the Debugbar. Please be aware that i refer to the first 'run' (if you could call it like that), the 'put' method, because it has to check the csrf-token.

I hope this helps making Debugbar an even better tool.

@barryvdh
Copy link
Owner

I think this is because it uses the Route information to check for filters. But these filters aren't applied to any route, but on the controller. Will see if I can find something to show the filters applied on the current route.

@barryvdh
Copy link
Owner

Can't really figure out how to get the filters for the current controller, sorry. If you find an easy way, please let me know!

@marcellus-jeanbernard
Copy link

Some one can help me please

public function __construct() {
$this->beforeFilter('csrf',array('on'=>'post'));
}
method is not working in my UsersController.php in laravel 5.5

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