Download the PHP package alhaji-aki/laravel-uuid without Composer
On this page you can find all versions of the php package alhaji-aki/laravel-uuid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alhaji-aki/laravel-uuid
More information about alhaji-aki/laravel-uuid
Files in alhaji-aki/laravel-uuid
Package laravel-uuid
Short Description Trait to generate uuid when creating models
License MIT
Informations about the package laravel-uuid
Generate slugs when saving Eloquent models
This package provides a trait that will generate a unique uuid when saving any Eloquent model.
Installation
You can install the package via composer:
Usage
Your Eloquent models should use the AlhajiAki\LaravelUuid\HasUuid
trait.
The trait contains an abstract method getUuidColumn()
that you must implement yourself.
Your models' migrations should have a field to save the uuid to.
Here's an example of how to implement the trait:
With its migration:
Using slugs in routes
To use the generated uuid in routes, remember to use Laravel's implicit route model binding:
Overriding slugs
You can also override the generated slug just by setting it to another value than the generated slug.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
This package is inspired by Spatie Laravel Sluggable.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-uuid with dependencies
illuminate/database Version ^7.30|^8.0|^9.0
illuminate/support Version ^7.30|^8.0|^9.0