leskhq / Laravel-Enterprise-Starter-Kit

👔 Enterprise Web application starter kit or template using Laravel
http://lesk.it
GNU General Public License v3.0
362 stars 176 forks source link

Remove old loaded routes on loading. #51

Closed Clivern closed 7 years ago

Clivern commented 7 years ago

Is there is any way i can remove old loaded routes from the database when i try to load a new routes. I know it should be performed on method loadLaravelRoutes in \App\Models\Route class.

sroutier commented 7 years ago

Hey @Clivern, you are right currently there is not automatic way to have old loaded routes deleted from the database. I simply never thought about that, good catch. I do not think that there is any use case for wanting to keep any old route that would have been removed from the source app/Http/routes.php, so I think simply removing them during the load call would make sense, of course then the load call will have to be renamed to sync or something like that. Any thoughts or objection on this approach?

/s

Clivern commented 7 years ago

Hi @sroutier, this approach is perfect :+1:

sroutier commented 7 years ago

Done. Give it a try & let me know. /S

Clivern commented 7 years ago

Ok :+1:

sroutier commented 7 years ago

Cool. Enjoy!