Open dillingham opened 6 years ago
I don't think this should be included as not everyone will have nova available.
What do you envision the flag would do? Generate a nova resource? Will it know how if Nova isn't installed? I imagined it would call artisan nova:resource
, which would fail if it's not installed.
So yes, it does hurt to have it there. It would appear as broken functionality. Yeah, you could catch that error and display a "Nova not installed" message instead. I just feel like that's crossing responsibilities too much. Let the framework do it's thing, and just take the 2 seconds to run the nova:resource
command manually right after generating the model. -m
generates a migration, but it's blank so you have to go populate that after as well.
I guess I don't see the benefit of it being in the framework.
Can Nova's artisan commands override/extend the core Laravel artisan commands in a way that adds the -n or other additions to the core commands?
@drbyte ah thats a good idea! Maybe it extends it and adds the flag
Would make it nova's responsibility & would only change make:model if nova is installed
Found an article that describes it: Extending Laravel’s migration command to add new options
Adding the
-n
flag forphp artisan make:model Post -n -m -f
would be wonderfulAnd have it make the nova Post resource behind the scenes