CrestApps / laravel-code-generator

An efficient Laravel code generator, saving time by automating the creation of resources such as views, controllers, routes, migrations, languages, and form-requests. Highly flexible and customizable, it includes a cross-browser compatible template and client-side validation for application modernization.
https://laravel-code-generator.crestapps.com
MIT License
737 stars 157 forks source link

Custom stub template types #208

Open relayer464 opened 2 weeks ago

relayer464 commented 2 weeks ago

Greetings,

First, thanks for creating this wonderful CRUD generator!

I was just wondering if there is a way to create custom stub templates? I have successfully copied the default stub template folder and have modified some of the existing stubs and generated custom controllers, blade files, etc. However, I would like to create stub templates for file types not already represented (for example, Laravel authorization policies, so something like policy.stub). Just wondering if this is possible, and if so, how?

If this isn't possible, I would like to suggest this as an enhancement.

Thanks!

MikeAlhayek commented 2 weeks ago

@relayer464 there is no command that would create policy for you. So you can't really create a policy stub.

If you are up for the challenge, submit a PR that would introduce create:policy command which exposes a new policy stub. This way you can customize the policy as needed.