A CMS would have dynamic routes for the frontend. Is that what you mean?
Dynamic routes.php from Eloquent
Hi there,
i was tinkering with an idea of storing all routes in my database, that usually are stored in the routes.php file.
The reason behind it, was to be able to connect routes and permissions directly via an eloquent relation + storing route translations as well ... (and be able to manage these in my applications backend)
I have a table called "Routes" and another table "Route_Translations".
Routes: id, location['frontend','backend', 'api'], alias, method, action, middleware
Route_Translations: id, route_id, language_id, url
Each Route can have many translations for all available languages.
My problem is not the implementation ...
Is there a downside to store all routes in my db?
I was thinking about security issues ... If i store all my routes in a db and someone could access my db, he/she will be able to cause a lot of trouble simply by altering the controller action or delete the table contents
(I will make use of route-caching later on - so performance shouldn't be a problem.)
Thanks for your ideas ...
hm, I think I will take an hybrid solution ... Store all routes in my relational database - BUT - generate a physical routes.php file each time an update event occured and recache the routes when done :-)
Please or to participate in this conversation.