Download the PHP package rollswan/uuid without Composer
On this page you can find all versions of the php package rollswan/uuid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download rollswan/uuid
More information about rollswan/uuid
Files in rollswan/uuid
Download rollswan/uuid
More information about rollswan/uuid
Files in rollswan/uuid
Vendor rollswan
Package uuid
Short Description Generates Universally Unique IDentifiers as primary key
License MIT
Package uuid
Short Description Generates Universally Unique IDentifiers as primary key
License MIT
Please rate this library. Is it a good library?
Informations about the package uuid
Universally Unique IDentifiers (UUID)
A Laravel package to generate uuid as primary keys.
How to use?
1) Install composer require rollswan/uuid
2) use uuid()
in migration,
Example:
Schema::create('posts', function (Blueprint $table) {
$table->uuid(); // you can also custom your uuid `uuid('post_uuid')`
$table->string('title');
$table->string('body');
$table->timestamps();
});
3) use WithUuid
trait in your Model and declare the primary key
Example:
namespace App;
use Rollswan\Uuid\Traits\WithUuid;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use WithUuid;
protected $primaryKey = 'uuid';
}
Done! This will automatically generate unique UUID whenever you save a new record.
All versions of uuid with dependencies
PHP Build Version
Package Version
No informations.
The package rollswan/uuid contains the following files
Loading the files please wait ....