Package to generate automatic cruds for Laravel BoilerPlate Apps

1.0.2 2017-01-10 00:24 UTC

This package is not auto-updated.

Last update: 2021-04-17 01:15:23 UTC


Package to generate automatic cruds for Laravel BoilerPlate Apps [Laravel 5 Boilerplate]

The amamarul:crud make:
1 - Model
2 - Model Trait Attribute
3 - Model Trait Relationship
4 - Model Trait Scope
5 - Form Request
6 - Controller
7 - Datatable as Service for Controller
8 - Routes
9 - Breadcrumbs

Install Boilerplate

$ git clone
$ cd laravel-5-boilerplate
$ composer install

Duplicate .env.example and rename to .env

$ php artisan key:generate

Set Database in .env

Install Package (Laravel)

Via Composer

$ composer require amamarul/boiler-plate-commands

Require Datatables Package

$ composer require yajra/laravel-datatables-buttons:^1.1

Service Provider


Configuration and Assets

$ php artisan vendor:publish --tag=datatables-buttons

Add the following to the AppServiceProvider in the register function:


 * Load third party local providers

The register function should look like this

public function register()
     * Sets third party service providers that are only needed on local/testing environments
    if ($this->app->environment() == 'local' || $this->app->environment() == 'testing') {
         * Loader for registering facades.
        $loader = \Illuminate\Foundation\AliasLoader::getInstance();

         * Load third party local providers

         * Load third party local aliases
        $loader->alias('Debugbar', \Barryvdh\Debugbar\Facade::class);

         * Load third party local providers

Publish the views

$ php artisan vendor:publish --provider='Amamarul\BoilerPlateCommands\Providers\BoilerPlateCommandsServiceProvider'


You need the tables migrated

create migration

$ php artisan make:migration create_products_table

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductsTable extends Migration
     * Run the migrations.
     * @return void
    public function up()
        Schema::create('products', function (Blueprint $table) {

     * Reverse the migrations.
     * @return void
    public function down()


$ php artisan migrate

Make the Crud

Run the following commands
amamarul:crud {name} {tabla} {seccion} {grupo?}
* name: Is the Model Name
* tabla: Is the table name
* seccion: can be 'Backend', 'Frontend' or the section you want
* grupo: if you want to group different Models and Controllers like sub sections. this is optional

This is an example for Backend and the group 'Products'. Then you can to add another model/controller in that group

$ php artisan amamarul:crud Product products Backend Products
  • The result in console will be
Model created successfully.
Request created successfully.
TraitAttribute created successfully.
TraitRelationship created successfully.
TraitScope created successfully.
Controller created successfully.
DataTable created successfully.
Routes created successfully.
Breadcrumbs created successfully.
  • Run php artisan serve
$ php artisan serve

Now you can go to http://localhost:8000/admin/products/product and you will show the datatable.

Go to app/Http/Controllers/Backend/Products/DataTables/ProductDataTable.php and uncomment the fields you want to show in the datatable in the getColumns() function (the last function), by default you will see only 'id', 'created_at' and 'updated_at'.


Contributions are welcome and will be fully credited.

I accept contributions via Pull Requests



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