lucid
lucid copied to clipboard
(Custom) stubs
I am making stubs as I want to include a copyright tag in each file and because I am migrating from PHPunit to PEST and want to change the test stubs to use PEST. I have made stubs in the stubs directory and Artisan recognises them but Lucid doesn't (E.G model.stub). I have looked into the source code and see that Lucid only reads its own stubs, could it be changed so that it also reads from the stubs folder?
Interesting case, i never thought nor needed to have a custom at the application level but your case is totally legit.
It would be beneficial to your case to have a --stub
command argument that specifies a custom location for a stub file. Would you be up for a PR with that change?
That would be helpful, although I think it would be better if Lucid would mimic Laravel. In other words: look for custom stubs in the stubs folder at the root, if that does not exist, use the default models.
The only change that would have to happen is for Lucid to refactor the getStub methods to something like the resolveStubPath method the ModelMakeCommand in Laravel
Specifically for this case, maybe it would be a good idea to contribute pest stubs and then make a config option where testing framework can be defined & correct stubs used based on the configuration?