PHP code example of vleroy / smart

1. Go to this page and download the library: Download vleroy/smart 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/ */

    

vleroy / smart example snippets




namespace App;

use Deiucanta\Smart\Field;
use Deiucanta\Smart\Model;

class Product extends Model
{
    public function fields()
    {
        return [
            Field::make('id')->increments(),
            Field::make('sku')->string()->fillable()->>timestamp()->nullable()->index(),
            Field::make('updated_at')->timestamp()->nullable()->index(),
        ];
    }
}



return [
    'models' => [
        \App\Product::class,
    ]
];

php artisan smart:model Product

php artisan smart:migration