PHP code example of faaren-tech / laravel-custom-uuids

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

    

faaren-tech / laravel-custom-uuids example snippets




namespace App\Models;

use FaarenTech\LaravelCustomUuids\Models\UuidModel;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends UuidModel implements
    AuthenticatableContract,
    AuthorizableContract,
    CanResetPasswordContract,
    HasCustomUuidInterface
{
    use Authenticatable, 
        Authorizable, 
        CanResetPassword, 
        MustVerifyEmail, 
        HasApiTokens, 
        HasFactory, 
        Notifiable;
        
    public function getUuidPrefix(): string
    {
        return "user";
    }
}