beautycoding / modelutils
Model utils for laravel
Installs: 123
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:utils
Requires
- ramsey/uuid: ^3.2
This package is not auto-updated.
Last update: 2024-11-05 21:12:35 UTC
README
In order to install Laravel 5 ModelUtils, just add
"beautycoding/modelutils": "dev-master"
to your composer.json. Then run composer install
or composer update
.
Then in your config/app.php
add
BeautyCoding\ModelUtils\ModelUtilsServiceProvider::class,
Publish config:
php artisan vendor:publish
Edit config file config/modelutils.php
with own namespace.
Use in proper model trait UuidModel
:
<?php use Illuminate\Database\Eloquent\Model; use BeautyCoding\ModelUtils\Traits\UuidModel; class User extends Model { use UuidModel; // add this trait to your model ... }
Model has to have field named uuid (32characters long). Check RFC for more information.