What is the best practice/ "Laravel" style when using routes and controllers for auth functionality? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

What is the best practice/ "Laravel" style when using routes and controllers for auth functionality?

For example, a simple interface which has a vertical list of items, each with its own data explaining what it is (like a normal shopping item on e-commerce). If you're a member, you can log in to another page that allows you to create new items and update them. With this in mind, should I use a single controller to place all the logic there, for public users and members. Or should the logic be separated?

26th Mar 2022, 5:02 PM
rafalzacher1
1 Antwort
+ 1
Imho you should separate the logic for the public content from the other logic, use two controllers it makes easier to understand what a unauthenticated user can see and do with your application
30th Mar 2022, 5:19 AM
Sebastian
Sebastian - avatar