PHP code example of webdevrus / laravel-uuid

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

    

webdevrus / laravel-uuid example snippets




namespace App\Models;

use WebDevRus\Laravel\UUID;

class Cart extends Model
{
    use UUID;

    ...
}

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



namespace App\Models;

use WebDevRus\Laravel\UUID;

class Cart extends Model
{
    use UUID;

    ...

    public function getKeyName(): string
    {
        return 'custom';
    }
}

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