The package allows user to extensively customize or use own templates.
To customize or change the template, you need to follow these steps:
-
Just make sure you've published all assets of this package. If you didn't just run this command.
php artisan vendor:publish --provider="Appzcoder\CrudGenerator\CrudGeneratorServiceProvider"
-
To override the default template with yours, turn on
custom_template
option in theconfig/crudgenerator.php
file.'custom_template' => true,
-
Now you can customize everything from this
resources/crud-generator/
directory. -
Even if you need to use any custom variable just add those in the
config/crudgenerator.php
file.
You can use any form helper package for your forms. In order to do that, you just need to mention the helper package name while generating the main CRUD or views with this option --form-helper
. This generator use plain html
as default helper.
Also, the laravelcollective/html
helper is included in the core, So it will do everything for you when you just run command with the option --form-helper=laravelcollective
.
To use the any other form helper, you need to follow these steps:
-
Make sure you've installed & configured the desire helper package.
-
For use custom helper template, you should turn on
custom_template
option in theconfig/crudgenerator.php
file. -
Now put your files into
resources/crud-generator/views/
directory. Suppose your helper ismyformhelper
then you should create a directory asresources/crud-generator/views/myformhelper
. You can also copy the template files from other helper directory, then modify as yours. -
You're ready to generate the CRUD with your helper.
php artisan crud:generate Posts --fields='title#string; content#text; category#select#options={"technology": "Technology", "tips": "Tips", "health": "Health"}' --view-path=admin --controller-namespace=Admin --route-group=admin --form-helper=myformhelper