wcr/entitize

A crud package for Laravel, with bootstrap and former

0.2.3 2018-06-05 13:43 UTC

This package is not auto-updated.

Last update: 2024-04-19 21:13:00 UTC


README

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require wcr/entitize

Usage

1. Publish components

$ php artisan vendor:publish --tag:entitize

2. Create Model whith Migration

$ php artisan make:model Book -m

edit migration /database/migrations/0000_00_00_000000_create_books_table.php

<?php
/** more code **/
    public function up()
    {
        Schema::create('books', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->string('autor');
            $table->date('published_at')->nullable();
            $table->boolean('deleted')->default(0); // This field is REQUIRED
            $table->timestamps();
        });
    }
/** more code **/
?>

Launch migration

$ php artisan migrate

3. Create controller

$ php artisan make:controller BookController

4. use entitize in controlle

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Wcr\Entitize\Controllers\Entitize;

use App\Book;

class BookController extends Controller
{
    use Entitize;

    public $tableParams = ['Id'=>'id', 'Title'=>'title', 'Author'=>'author', 'Created at'=>'created_at'];

    public $fields = array(
        [
            'name' => 'title',
            'label' => 'Title',
            'validation' => 'required'
        ],
        [
            'name' => 'author',
            'label' => 'Author',
            'validation' => 'required'
        ],
        [
            'name' => 'published_at',
            'label' => 'Published at',
            'type' => 'date'
        ],
    );
}

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.