PHP code example of kblais / laravel-uuid

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

    

kblais / laravel-uuid example snippets


$table->char('id', 36);
$table->primary('id');

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



namespace App;

use Illuminate\Database\Eloquent\Model;
use Kblais\Uuid\Uuid;

class User extends Model
{
    use Uuid;
}

protected $uuidVersion = 1;
protected $uuidString  = ''; // only needed when $uuidVersion is "3 or 5"