luthfi/simple-crud-generator
We are adding a new --parent-model option to create a CRUD feature nested with existing model.
I often creating a CRUD feature nested with the existing model, like:
Since this package was (only) for creating the "first-class citizen" CRUD feature, I always create the nested CRUD feature manually (off course using TDD approach).
I hope this command new --parent-model option can save my time more.
When 1 department has many section, then we are adding a nested controller like so:
Route::resource('departments.sections', Departements\SectionController::class);
So we will have routes like:
GET departments/{department}/sections
GET departments/{department}/sections/{section}
GET departments/{department}/sections/create
POST departments/{department}/sections
GET departments/{department}/sections/{section}
GET departments/{department}/sections/{section}/edit
PATCH departments/{department}/sections/{section}
DELETE departments/{department}/sections/{section}
Including the model, controller, views, feature test, unit tests.
When we run:
php artisan make:crud --parent-model=Department Section
We will have a working Section CRUD feature with title and description attribute under Departments namespace, completed with tests.
--bs4 to generate CRUD files with Bootstrap 4 views.--bs5 to generate CRUD files with Bootstrap 5 views.config('simple-crud.default_bootstrap_version') to define the default bootstrap version.--uuid with --form-requests options.__('app.create') for the create form button.This release is created to support laravel projects that has upgraded from laravel 5.7 to 5.8. Since laravel 5.7 using integer increments and laravel 5.8 is using big integer increments.
So, if we are using this package with fresh laravel 5.8 installation, use 1.3.x version. If we are using this package with laravel 5.7 or older, use 1.2.x instead.
In this version, we add --form-requests command option. This option will:
CreateRequest and UpdateRequest class in app\Http\Requests\PluralModelName directory.CreateRequest class in store method, and uses UpdateRequest in update method.In this release, we support Bootstrap 4, and generate Bootstrap 4 views by default.
--bs3 command option.In this release, we remove the dependency of luthfi/formfield package. So the package will generate basic html structure on each view creations.
Changelog:
VehicleController instead of VehiclesController.--formfield command option.$ php artisan make:crud Vehicle --formfield
How can I help you explore Laravel packages today?