2017 © Pedro Peláez
 

library boiler-plate-commands

Package to generate automatic cruds for Laravel BoilerPlate Apps

image

amamarul/boiler-plate-commands

Package to generate automatic cruds for Laravel BoilerPlate Apps

  • Sunday, April 22, 2018
  • by amamarul
  • Repository
  • 6 Watchers
  • 14 Stars
  • 97 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

BoilerPlateCommands

Package to generate automatic cruds for Laravel BoilerPlate Apps [Laravel 5 Boilerplate], (*1)

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, (*2)

Install Boilerplate

``` bash $ git clone https://github.com/rappasoft/laravel-5-boilerplate.git, (*3)


``` bash $ cd laravel-5-boilerplate

``` bash $ composer install, (*4)

## Duplicate .env.example and rename to .env

``` bash
$ php artisan key:generate

Set Database in .env

Install Package (Laravel)

Via Composer

``` bash $ composer require amamarul/boiler-plate-commands, (*5)

### Require Datatables Package

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

Service Provider ``` php Yajra\Datatables\ButtonsServiceProvider::class, (*6)


Configuration and Assets ``` bash $ php artisan vendor:publish --tag=datatables-buttons

Add the following to the AppServiceProvider in the register function:

app/Providers/AppServiceProvider.php

``` php /* * Load third party local providers */ $this->app->register(\Amamarul\BoilerPlateCommands\Providers\BoilerPlateCommandsServiceProvider::class);, (*7)


## The register function should look like this ``` php 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 */ $this->app->register(\Barryvdh\Debugbar\ServiceProvider::class); /* * Load third party local aliases */ $loader->alias('Debugbar', \Barryvdh\Debugbar\Facade::class); /* * Load third party local providers */ $this->app->register(\Amamarul\BoilerPlateCommands\Providers\BoilerPlateCommandsServiceProvider::class); } }

Publish the views

``` bash $ php artisan vendor:publish --provider='Amamarul\BoilerPlateCommands\Providers\BoilerPlateCommandsServiceProvider', (*8)

# Usage

You need the tables migrated

## create migration
``` bash
$ php artisan make:migration create_products_table

``` php <?php, (*9)

use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration;, (*10)

class CreateProductsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('products', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->timestamps(); }); }, (*11)

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::dropIfExists('products');
}

}, (*12)

## Migrate
``` bash
$ 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, (*13)

This is an example for Backend and the group 'Products'. Then you can to add another model/controller in that group ``` bash $ php artisan amamarul:crud Product products Backend Products, (*14)

- **The result in console will be**
``` bash
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 bash $ 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'., (*15)

Contributing

Contributions are welcome and will be fully credited., (*16)

I accept contributions via Pull Requests, (*17)

Credits

License

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

The Versions

22/04 2018

dev-master

9999999-dev

Package to generate automatic cruds for Laravel BoilerPlate Apps

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maru Amallo

laravel boilerplate package

10/01 2017

1.0.1

1.0.1.0

Package to generate automatic cruds for Laravel BoilerPlate Apps

  Sources   Download

MIT

by Maru Amallo

laravel boilerplate package

10/01 2017

1.0.2

1.0.2.0

Package to generate automatic cruds for Laravel BoilerPlate Apps

  Sources   Download

MIT

by Maru Amallo

laravel boilerplate package

10/01 2017

1.0.0

1.0.0.0

Package to generate automatic cruds for Laravel BoilerPlate Apps

  Sources   Download

MIT

by Maru Amallo

laravel boilerplate package