| Package Data | |
|---|---|
| Maintainer Username: | uyab |
| Maintainer Contact: | yohang88@gmail.com (Yoga Hanggara) |
| Package Create Date: | 2015-11-13 |
| Package Last Update: | 2016-05-14 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-10 03:15:04 |
| Package Statistics | |
|---|---|
| Total Downloads: | 1,302 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 8 |
| Total Watchers: | 2 |
| Total Forks: | 2 |
| Total Open Issues: | 0 |
Generate UUID automatically when creating/inserting new data.
Via Composer
$ composer require laravolt/eloquent-uuid
Then register the service provider, head over your config/app.php file and add the following line into the providers array:
Laravolt\Database\Eloquent\UuidServiceProvider::class,
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'];