Resource generation CLI & Structure Manager dependency for Laravel Enso
This package works exclusively within the Enso ecosystem.
For live examples and demos, you may visit laravel-enso.com
click on the photo to view a short demo in compatible browsers
Comes pre-installed in Enso.
- comes with its own easy to use CLI for the creation of Enso resources
- can be used to more easily insert (default) data, during the install of a package, or later when new routes and permissions are required and can create menus, assign default permissions, etc.
- extends Illuminate's
Migrationclass and acts like a migration
- can also rollback its own changes
- when adding menus and permissions, automatic access for the administrator role is added
The packages includes a command line interface is a powerful tool meant to help you quickly create the needed files structure when adding new resources for your application.
You can use it to create:
- permissions and permission groups
- front-end routes
- back-end routes
- form builders
- json templates (boilerplate)
- specific validation request
- form controllers
- table builders
- table templates (boilerplate)
- table controllers
You may run the CLI with the following command:
php artisan enso:make:structure
You'll be presented with a menu you may use for configuring the creation of resources. Some of the options may depend on other options, so if you choose something that has such dependencies, you'll be notified.
The CLI menu options are listed in a logical order, as, for instance, you can't add Permissions without first specifying a Permission Group.
When choosing an option, you'll also be presented with the current configuration for that option especially useful when going back to edit some of the options.
When editing an option, you may start typing to get an autocomplete option, for the currently configured value.
After configuring the desired options, you should select the Files you want generated.
When satisfied with your selection, use the Generate option to have the files created.
Once the files are generated, depending on your choices,
you'll also be presented with the backend routes you'll need to paste in your
If you've created front-end resources, don't forget to rebuild your js resources,
npm run webpack or similar.
The available options are listed below:
- type in a name for the model;
As per the Laravel convention, models should be upper-camel-cased
 Permission Group
- type in the name for the permission group
Note that per Enso convention, the name must coincide with the common part of the resource permission.
administration.users is used for the Users' permission group.
- select which resources you want permissions generated for
The permissions will be generated for you, there is no need to configure anything else here.
- type a name for the menu; this will be the user-visible label
- type in the desired Font Awesome icon class; make sure to have the given class imported and available
- type in the name of the parent menu, if applicable (for example
- type in the name of the route used when clicking on the menu (for example
- type in the order index for this menu element; This is used for the ordering of the menus and submenus
- choose whether a certain menu will have children
- choose which files you want generated by the tool
Note than one selection will generate the required files for that resource,
for instance, choosing
model will generate just the model class, but choosing
will generate a controller, a builder, a template and a validation request.
Choosing this option will generate the files based on your configuration and selections.
Choosing this option will toggle the validation that is being normally performed before the generation of the structure & files
php artisan enso::make:structure- runs the structure creation CLI
php artisan vendor:publish --tag=structuremanager-config- configuration file
php artisan vendor:publish --tag=enso-config- a common alias for when wanting to update the configuration, once a newer version is released, usually used with the
are welcome. Pull requests are great, but issues are good too.
This package is released under the MIT license.