PHP code example of glorand / laravel-eloquent-model-uuid

1. Go to this page and download the library: Download glorand/laravel-eloquent-model-uuid 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/ */

    

glorand / laravel-eloquent-model-uuid example snippets


$table->uuid('id');
$table->primary('id');
//OR
$table->uuid('id')->primary();


use Glorand\LaravelEloquentModelUuid\Database\Eloquent\Model;

class Entity extends Model
{
    //
}


use Illuminate\Database\Eloquent\Model;
use Glorand\LaravelEloquentModelUuid\Database\Concerns\Uuid;

class Entity extends Model
{
    use Uuid;
    
    /**
     * The "type" of the auto-incrementing ID.
     *
     * @var string
     */
    protected $keyType = 'string';

    /**
     * Indicates if the IDs are auto-incrementing.
     *
     * @var bool
     */
    public $incrementing = false;
    //
}