DEV Community

loading...
Cover image for What is the most overlooked Laravel feature?

What is the most overlooked Laravel feature?

bertheyman profile image Bert Heyman ・1 min read

Tell us about hidden gems and useful -but often overlooked- features!

What do you like about it?
Why might it not be used as much as it should?

Bonus points if you include an article with an introduction for others to learn.

Discussion (4)

pic
Editor guide
Collapse
bobbybouwmann profile image
Bobby Bouwmann

I'm a big fan of the console commands and how you can utilize them to actually make commands fun again. You can add tables in there, colors, progress bars, etc. It really makes importing a lot of data fun as an example!

Collapse
bertheyman profile image
Bert Heyman Author

My own nomination: Query scopes

In short, they provide the ability to split your queries in building blocks, resulting in better readability (especially if things get complex!) and them being easier to maintain.

You don't really need them to write your query, which is why they are easily forgotten.

I once wrote an introduction for anyone looking to get started with query scopes.

Collapse
khalyomede profile image
Khalyomede

Query scopes are on fire indeed!

Collapse
khalyomede profile image
Khalyomede

Form requests, help extracting validation logic out of controller, and let you share common request validation across controllers.

I do not see them used that often, and still are for me one of the greatest feature to help keep a readable code, alongside query scopes like Bert noticed.