DEV Community

Discussion on: Multiple role-based authentication in Laravel

 
picwellwisher12pk profile image
Amir Hameed

These if statements could also be one-liners to save some more characters and space.

Thread Thread
 
martin_betz profile image
Martin Betz

Yes, but there still would be lots of repetitions even in short-form. Maybe I can write an own article soon about possible refactorings so that people can learn and compare. The original poster went with the simple if solution but there are multiple ways to make it shorter and easier to maintain.

Thread Thread
 
picwellwisher12pk profile image
Amir Hameed

Indeed.
Tell me where can I start a new discussion?

Thread Thread
 
martin_betz profile image
Martin Betz

Just put a comment on the root of this article: dev.to/kaperskyguru/multiple-role-...