Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xzxzyzyz/laravel-uuid-model
This package allows you to easily work with UUIDs in your Laravel models
https://github.com/xzxzyzyz/laravel-uuid-model
eloquent laravel model uuid
Last synced: about 2 months ago
JSON representation
This package allows you to easily work with UUIDs in your Laravel models
- Host: GitHub
- URL: https://github.com/xzxzyzyz/laravel-uuid-model
- Owner: xzxzyzyz
- License: mit
- Created: 2018-10-04T06:53:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-01T08:04:20.000Z (10 months ago)
- Last Synced: 2024-11-21T04:51:31.590Z (2 months ago)
- Topics: eloquent, laravel, model, uuid
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Uuid Model
[![Build Status](https://travis-ci.com/xzxzyzyz/laravel-uuid-model.svg?branch=master)](https://travis-ci.com/xzxzyzyz/laravel-uuid-model)
[![Latest Stable Version](https://poser.pugx.org/xzxzyzyz/laravel-uuid-model/version)](https://packagist.org/packages/xzxzyzyz/laravel-uuid-model)
[![License](https://poser.pugx.org/xzxzyzyz/laravel-uuid-model/license)](https://packagist.org/packages/xzxzyzyz/laravel-uuid-model)Using `uuid` in eloquent model.
## Installation
```bash
composer require xzxzyzyz/laravel-uuid-model
```## Usage
Create primary key as string type.
```php
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('example', function(Blueprint $table) {
$table->uuid('id')->primary();
// ...
});
}
```And, Extends `Xzxzyzyz\Laravel\Uuid\Model` in your model.
```php
use Xzxzyzyz\Laravel\Uuid\Model;class Example extends Model
{
//...
}
```