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

I would not use FormRequest to handle auth for views, that's not what it's made for. I would normally handle this in the routes file, is there any specific reason you don't want to do that?

Last updated 2 years ago.
0

Because now i need to duplicate permissions logic in two places (FormRequest class and before form view), i want to define it in one place so it would be used before both showing form and handling its post.

So the best option would be to create separate class witch handles permissions logic:

  • GET: class can be used directly
  • POST: FormRequest class uses permission checking class in background
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

revati revati Joined 31 Jan 2014

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.