2017 © Pedro Peláez
 

library crud

a package for crud

image

wcr/crud

a package for crud

  • Thursday, March 8, 2018
  • by francescomonti
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

wcr-crud

Laravel crud package. The views are optimized for https://github.com/jeroennoten/Laravel-AdminLTE, (*1)

Required

Laravel 5.5 https://laravel.com/docs/5.5, (*2)

Former https://github.com/formers/former, (*3)

Install

Download package and setting, (*4)

$ composer require wcr/crud
$ php artisan vendor:publish --tag=migrations
$ php artisan migrate
$ php artisan vendor:publish --tag=abilities

We use laravel pre-built authentication, (*5)

$ php artisan make:auth

Modify file: /app/User.php, (*6)

<?php

namespace App;

use Wcr\Crud\Rolify;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;
    use Rolify;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
}

Example

Use CRUD for entity Post: file: /app/Http/Controllers/PostController.php, (*7)

<?php

namespace App\Http\Controllers;

use App\Post;
use Wcr\Crud\Http\CrudController;

class PostController extends CrudController
{

    public $modelClass = 'App\Post'; // REQUIRED to define the model class

    public $acceptedAttributes = array( 'title', 'body' ); // REQUIRED to define accepted attributes by form

    public $validateRules = array( 'title' => 'required', 'body' => 'required' ); // OPTIONAL to define form validation

}

file: /app/Post.php, (*8)

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Wcr\Crud\Entitize;

class Post extends Model
{
    use Entitize;
}

The Versions

08/03 2018

dev-master

9999999-dev

a package for crud

  Sources   Download

The Requires

 

08/03 2018

v0.5.2

0.5.2.0

a package for crud

  Sources   Download

The Requires

 

08/03 2018

v0.5.1

0.5.1.0

a package for crud

  Sources   Download

The Requires

 

07/03 2018

v0.4

0.4.0.0

a package for crud

  Sources   Download

The Requires

 

26/02 2018

v0.3

0.3.0.0

a package for crud

  Sources   Download

The Requires

 

26/02 2018

v0.2

0.2.0.0

a package for crud

  Sources   Download

The Requires

 

24/02 2018

v0.1

0.1.0.0

a package for crud

  Sources   Download

The Requires