pelletiermaxime/laravel-scaffold-admin

Commands to generate scaffolding for an admin CRUD.

dev-master 2016-02-21 04:32 UTC

This package is not auto-updated.

Last update: 2024-11-09 20:01:38 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Installation

Via Composer

$ composer require pelletiermaxime/laravel-scaffold-admin
$ php artisan vendor:publish

Usage

Scaffold everything (migration, model, controller, routes and views)

php artisan scaffold-admin:generate  Scaffold an admin CRUD

name : Name of the model
--fields= : Comma-separated list of fields in the format COLUMN_NAME:COLUMN_TYPE.

Examples:

php artisan scaffold-admin:generate Posts

will generate the file app/Http/Controllers/Admin/PostsController.php with a PostsController class, generate a route for /admin/posts in routes.php, generate an empty model Posts, generate a migration file with the default values (an ID and the timestamp fields) and generate CRUD views.

Scaffold a Controller

php artisan scaffold-admin:controller  Scaffold an admin controller for a model

name : Name of the associated model
--controller-name=$modelController : Controller name. Defaults to name of the model followed by Controller
--no-route : Disable the default route appended to your routes.php file.

Examples:

php artisan scaffold-admin:controller Posts

will generate the file app/Http/Controllers/Admin/PostsController.php with a PostsController class.

php artisan scaffold-admin:controller Posts --controller-name=Posts

will generate the file app/Http/Controllers/Admin/Posts.php with a Posts class.

Scaffold a Migration file

php artisan scaffold-admin:migration   Scaffold a migration file.

name : Name of the migration
--fields= : Comma-separated list of fields in the format COLUMN_NAME:COLUMN_TYPE.

Behind the scene this command uses the great package laracasts/generators. Have a look at the documentation for detailed examples.

Examples:

php artisan scaffold-admin:migration create_posts_table --fields="name:string"

Scaffold a Model file

php artisan scaffold-admin:model       Scaffold a model class.

name : Name of the model

Examples:

php scaffold-admin:model Posts

Scaffold a View file

php artisan scaffold-admin:view        Scaffold the views for a model

name : Name of the view

Examples:

php artisan scaffold-admin:view posts

will generate the file resources/views/admin/posts/index.blade.php and all the layout files for AdminLTE.

Don't forget to publish the assets (php artisan vendor:publish) to publish all the css/js necessary for AdminLTE.

Change log

Please see CHANGELOG for more information what has changed recently.

Credits

Thanks to the following packages for the inspiration :

https://github.com/laracasts/Laravel-5-Generators-Extended https://github.com/acacha/adminlte-laravel/

License

The MIT License (MIT). Please see License File for more information.