kevincobain2000 / laravel-erd

Automatically generate ERD Diagrams from Model's relations in Laravel
https://medium.com/web-developer/laravel-automatically-generate-interactive-erd-from-eloquent-relations-83fe65440716
138 stars 25 forks source link

Disable route #14

Closed nie7321 closed 2 years ago

nie7321 commented 2 years ago

I only want to generate HTML during my build process. I do not want my app to serve the ERD diagram, so it would be nice if I could disable the route.

Right now I sort of can by adding a middleware to deny access -- but that feels like kind of a hack. Maybe setting up the route could be skipped if I change it to null in the config?

kevincobain2000 commented 2 years ago

How about adding a middleware here

https://github.com/kevincobain2000/laravel-erd/blob/master/config/laravel-erd.php#L7

kevincobain2000 commented 2 years ago

Maybe setting up the route could be skipped if I change it to null in the config?

Thanks, yes that could also be done however it is only installed as dev dependency, so your prod builds should not have the route if you do composer install --prefer-dist --no-dev