lumen-generator icon indicating copy to clipboard operation
lumen-generator copied to clipboard

Support for `php artisan stub:publish`?

Open simplenotezy opened this issue 4 years ago • 1 comments

I was wondering if we could get support for php artisan stub:publish?

simplenotezy avatar Aug 29 '21 17:08 simplenotezy

Yup, It is possible ! I think about it too.

We need to refactor the directory of loaded stubs file from each generator command into custom directory if exist and the fallback is the origin one.

For example :

At file :

src/LumenGenerator/Console/CastMakeCommand.php

There is protected getStub() function :

    /**
     * Get the stub file for the generator.
     *
     * @return string
     */
    protected function getStub()
    {
        return __DIR__.'/stubs/cast.stub';
    }

We should change something like :

    /**
     * Get the stub file for the generator.
     *
     * @return string
     */
    protected function getStub()
    {
        return (config('flipbox.stub.dir') ? config('flipbox.stub.dir') : __DIR__) . '/stubs/cast.stub';
    }

yuliusardian avatar Sep 14 '21 10:09 yuliusardian