PHP code example of laravolt / eloquent-uuid
1. Go to this page and download the library: Download laravolt/eloquent-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/ */
laravolt / eloquent-uuid example snippets
php
Laravolt\Database\Eloquent\UuidServiceProvider::class,
php
Schema::create('users', function (Blueprint $table) {
// Create UUID column
$table->char('id', 32)->primary();
$table->string('name');
});
php
namespace App;
use Laravolt\Contracts\Eloquent\Uuid as UuidContract;
use Laravolt\Database\Eloquent\Uuid;
class Book extends Model implements UuidContract
{
use Uuid;
// Uuid Columns
protected $uuid = ['id'];