Package Data | |
---|---|
Maintainer Username: | bluora |
Maintainer Contact: | rocco@hnh.digital (Rocco Howard) |
Package Create Date: | 2016-06-15 |
Package Last Update: | 2018-10-21 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-21 03:03:39 |
Package Statistics | |
---|---|
Total Downloads: | 109 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 7 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Provides a collection of useful traits for Laravel Eloquent models.
This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital.
Via composer:
$ composer require hnhdigital-os/laravel-model-traits ~1.0
Add or save a model with model based attribute rules.
use Bluora\LarvelModelTraits\ModelValidationTrait;
class User extends Model
{
use ModelValidationTrait;
}
Automatically call an event for created and updated on a model.
use Bluora\LarvelModelTraits\ModelEventsTrait;
class User extends Model
{
use ModelEventsTrait;
}
Adds
use Bluora\LarvelModelTraits\OrderByTrait;
class User extends Model
{
use OrderByTrait;
protected $default_order_by = 'name';
protected $default_order_direction = 'asc';
}
$model->order('FIELD(status,3,2,1)', 'desc');
$model->order('other_model.status', 'desc');
Adds support for functions relating to the state of a model provided by the Eloquent ORM.
The feature is exposed through a trait by casting your UUID columns as uuid
.
use Bluora\LarvelModelTraits\ModelStateTrait;
class User extends Model
{
use ModelStateTrait;
}
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.