PHP code example of cleaniquecoders / laravel-uuid

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

    

cleaniquecoders / laravel-uuid example snippets

 
$table->uuid('uuid')->default('-');
 
use Illuminate\Database\Eloquent\Model;
use CleaniqueCoders\LaravelUuid\Contracts\HasUuid as HasUuidContract;
use CleaniqueCoders\LaravelUuid\Traits\HasUuid;

class User extends Model implements HasUuidContract
{
    use HasUuid;
}
 
$user = User::uuid($uuid)->first();
 
use CleaniqueCoders\LaravelUuid\Observers\UuidObserver;
use App\User;
...
public function boot()
{
    User::observe(UuidObserver::class);
}