7nohe / laravel-typegen

The library lets you generate TypeScript types from your Laravel code
79 stars 5 forks source link

feat: exclude vendor routes by default and add cli option #20

Closed 4lun closed 8 months ago

4lun commented 8 months ago

Currently working on a project with Laravel Nova, it generates a lot of routes with many route name collisions that breaks the generated param.ts

image

params.ts

image

One solution that works for us is to modify the php artisan route:list --json call to include --except-vendor

--except-vendor              Do not display routes defined by vendor packages

Have added it here as an extra option, and seems like it might be a sane default given that the other vendored routes I've come across (examples below) don't seem like ones that would typically be utilised (e.g. DebugBar, Laravel Dusk, Laravel Ignition)

image