laravel / folio

Page based routing for Laravel.
MIT License
568 stars 46 forks source link

Default route name #103

Closed onemoreahmad closed 1 year ago

onemoreahmad commented 1 year ago

Instead of manually go to each view and set the route name Laravel\Folio\name('website.register'), wouldn't be nice to set default route name for each view/page dynamically?

For example pages/login.blade.php => route('login') and pages/users/profile => route('users.profile')

Aaand to be greedy would add As() option to the Folio::path(..)->as('website.'), so all routes now inside this path would have its route name as route('website.login') and ('website.users.profile')

This is just a feature idea I thought about the other day, Thanks 💌

driesvints commented 1 year ago

This has been proposed before. Having to set the route name automatically defeats the purpose of route names alltogether. If you rename the file you'll have to change all route names. In that case you could also just change all urls.