A templating engine designed to generate supporting boilerplate using the Fabled pattern.
This can generate the following boilerplate:
- Vue listing page (with built-in paginated table and searching)
- Vue modal for creating and editing
- Vuex Store file
- Vuex Module Loader file
- API Controller with stubbed functions
- Service class with CRUD logic
- Web Controller for viewing the listing page
- Modify
web.php
- Modify
api.php
All of these files will be ready to use out of the box. You only need to create the relevant migration and fill out the Create/Update/Delete functions.
When you run the command, the package will prompt for each file generation. Optionally, if you pass the --all
parameter, it will generate all files without prompting.
php artisan templar:make {name} {--all}
First, generate the model and migration (optional):
php artisan make:model Member --migration
To generate boilerplate for a Member
:
php artisan templar:make Members
To generate without prompts:
php artisan templar:make Members --all
You may pass a lowercase and non-plural name
if you prefer. The command will automatically handle capitalization and pluralization using Laravel's built-in Str::plural
helper function.
For example:
php artisan templar:make city --all
This will generate the correct Cities
and City
equivalents.
The stub files can be published for customization:
php artisan templar:publish-stubs
The command does not generate the backing Model or Migration.