Today I come across a use case where I need to minimise writing route('resources.index)` and so on, all related to resourceful routes. Can it be more simpler if based on given model, I can simply get the model's resourceful URL without think much what's the name of the resourceful route? What I mean, I don't want to remember anything about given model, what's its route names.

For instance, if given model is \App\Models\User, it's URI always in lower case, plural and kebab case - http://domain.com/users for users.index, http://domain/users/1 for users.show.

Yes, but work smart - create a base model that later on, all models extend from the base class.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners