Downloads
Stars
Version
This is where your description should go. Take a look at contributing.md to see a to do list.
Via Composer
$ composer require wcr/entitize
$ php artisan vendor:publish --tag:entitize
$ 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
$ php artisan make:controller BookController
<?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'
],
);
}
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
license. Please see the license file for more information.