DEV Community

Cover image for What is the most overlooked Laravel feature?
Bert Heyman
Bert Heyman

Posted on

What is the most overlooked Laravel feature?

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.

Top comments (4)

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

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
 
anwar_nairi profile image
Anwar

Query scopes are on fire indeed!

Collapse
 
anwar_nairi profile image
Anwar

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.