jkg / backpack-generators
Generate files for laravel projects
dev-main
2022-10-19 06:29 UTC
Requires
- jkg/backpack-crud: dev-main
Requires (Dev)
- phpunit/phpunit: ^9.0||^7.0
- scrutinizer/ocular: ~1.1
Suggests
- jkg/backpack-crud: Quickly build an admin interfaces using Laravel, CoreUI, Bootstrap and jQuery.
This package is auto-updated.
Last update: 2025-03-19 11:30:26 UTC
README
Quickly generate Backpack templated Models, Requests, Views and Config files for projects using Backpack for Laravel as their admin panel.
Install
Via Composer
composer require jkg/backpack-generators
php artisan backpack:install
Usage
Open the console and enter one of the commands:
- Generate Backpack\CRUD interfaces for all Eloquent models that don't already have one:
php artisan backpack:build
- Generate all files for one new Backpack\CRUD interface:
php artisan backpack:crud {Entity_name} # Use singular, either PascalCase, snake_case or kebab-case. # This will create a Model if there isn't one, or add # our CrudTrait to the model if it already exists.
- Generate all files for a custom admin panel page:
php artisan backpack:page {PageName} # You can use either PascalCase, snake_case or kebab-case. # This will generate you a Controller, a view and a route.
- Generate a new Backpack\CRUD file:
php artisan backpack:crud-controller {Entity_name} php artisan backpack:crud-model {Entity_name} php artisan backpack:crud-request {Entity_name}
- Generate a model (available options: --softdelete)
php artisan backpack:model {Entity_name}
- Generate a request
php artisan backpack:request {Entity_name}
- Generate a view (available options: --plain)
php artisan backpack:view {Entity_name}
- Generate a config file
php artisan backpack:config {Entity_name}
- Generate a button
php artisan backpack:button {button_name}
- Generate a field
php artisan backpack:field {field_name} // or generate a field starting from another field php artisan backpack:field {field_name} --from={original_field_name}
- Generate a column
php artisan backpack:column {column_name} // or generate a column starting from another column php artisan backpack:column {column_name} --from={original_column_name}
- Generate a filter
php artisan backpack:filter {filter_name} // or generate a filter starting from another filter php artisan backpack:filter {filter_name} --from={original_filter_name}
- Generate a widget
php artisan backpack:widget {widget_name} // or generate a widget starting from another widget php artisan backpack:widget {widget_name} --from={original_widget_name}