PHP code example of saade / laravel-uuid
1. Go to this page and download the library: Download saade/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/ */
saade / laravel-uuid example snippets
class Post extends Model
{
use \Saade\Uuid\Concerns\HasUuid;
}
class Post extends Model
{
use \Saade\Uuid\Concerns\HasUuid;
public function uuidColumn(): string
{
return 'guid';
}
}
use Saade\Uuid\Uuid;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
Uuid::generateFor([
\App\Models\Post::class,
]);
}
}