Support the ongoing development of Laravel.io →
Authentication Security Forms
Last updated 2 years ago.
0

You might want to consider moving the auth checks into __constuct(). Then you wouldn't need to repeat yourself in each function. Then there's no chance of hitting a function that can skip auth.

Also you could use auth as middleware.

I tend to use auth on my routes and in __construct(), but also in conjunction with spatie/laravel-permission so I can be more granular about what roles and permissions are allowed to do.

0

Thank you for your suggestion. So it is safe to use it in general?

Last updated 6 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.