dscheff / crud-generator
Laravel Crud Generator with Column Filters
Fund package maintenance!
awais-vteams
Ko Fi
Requires
- laravel/framework: ^5.5|^6.20.12|^7.0|^8.0|^9.19
- laravelcollective/html: ^5.4|^6.0|^7.0|^8.0
This package is auto-updated.
Last update: 2024-09-27 04:02:00 UTC
README
This package is a fork of https://packagist.org/packages/ibex/crud-generator, and adds column sorting and filtering to the index view, as well as a handful of other tweaks.
This Laravel Generator package generates your MVC code (with eloquent relations) in Bootstrap for your app development, with a single command.
@todo - Add related models to the sorting and filtering
@todo - Adding subview generation for views that integrate mutiple models, with Ajax/modal/inline forms
- Will create Model with Eloquent relations
- Will create Controller with all resources
- Will create views in Bootstrap 4
- Will add Column Sorting and Filtering to your index action/view
Requirements
Laravel >= 5.5
PHP >= 7.1
Installation
1 - Install
composer require dscheff/crud-generator --dev
2 - Publish the default package's config, and js/css assets
php artisan vendor:publish --tag=crud
php artisan vendor:publish --tag=public --force
You will need to add the following to your app layout, just inside your closing body tag:
@stack('scripts-body')
</body>
Usage
php artisan make:crud {table_name}
php artisan make:crud banks
Add a route in web.php
Route::resource('banks', 'BankController');
Route name in plural slug case.
Options
- Custom Route
php artisan make:crud {table_name} --route={route_name}
- Custom Display Name for Views
php artisan make:crud {table_name} --title={displayed_model_name}
php artisan make:crud sales_rep --title="Sales Representatives"
Example
Author(s)
Daniel Scheff, on the back of the great work of M Awais (https://packagist.org/packages/ibex/crud-generator)