Package Data | |
---|---|
Maintainer Username: | disitec |
Maintainer Contact: | fjmartinez@disitec.es (Francisco Javier Martinez) |
Package Create Date: | 2016-12-22 |
Package Last Update: | 2016-12-28 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-21 03:01:45 |
Package Statistics | |
---|---|
Total Downloads: | 47 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 3 |
Total Forks: | 0 |
Total Open Issues: | 0 |
This is an extension of the infyomlabs/laravel-generator package. Documentation is located here
If you prefer less boilerplate in your generated stuff you can use this package instead.
"require": {
"disitec/laravel-generator": "^0.1",
"infyomlabs/laravel-generator": "5.3.x-dev"
}
Run composer udpdate
Add following service providers into your providers array in config/app.php
\Disitec\LaravelGenerator\LaravelGeneratorServiceProvider::class,
\InfyOm\Generator\InfyOmGeneratorServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
Laracasts\Flash\FlashServiceProvider::class,
Add following aliases into your aliases array in config/app.php
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Flash' => Laracasts\Flash\Flash::class,
Run this command in console: php artisan disitec:init
This command will create the config, the simplified stub for controller and model and the menu layout.
If you want to translate your Views you can run php artisan vendor:publish --tag=disitec-generator.lang
You have two files:
One for the models, with this structure (You can use a pipe for declaring plural)
return [
'brand' => 'Marca|Marcas',
'customer' => 'Cliente|Clientes',
'product' => 'Producto|Productos',
'provider' => 'Proveedor|Proveedores',
'supplier' => 'Proveedor|Proveedores',
];
And one for the fields:
return [
'id' => 'Id',
'name' => 'Nombre',
'email' => 'E-mail',
'createdAt' => 'Creado',
'updatedAt' => 'Editado'
];
You can create one folder for each locale that you need.
Run php artisan disitec:scaffold YourModel
Example:
php artisan disitec:scaffold Customer
You'll be prompted for the fields. You can follow this guide from the original package.