PHP code example of wcr / entitize

1. Go to this page and download the library: Download wcr/entitize library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wcr / entitize example snippets




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' => '
 bash
$ php artisan vendor:publish --tag:entitize
 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 **/
 bash
$ php artisan migrate
 bash
$ php artisan make:controller BookController