Download the PHP package saritasa/eloquent-custom without Composer
On this page you can find all versions of the php package saritasa/eloquent-custom. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package eloquent-custom
Eloquent Extensions and Helpers
Custom Extensions for Eloquent
See https://laravel.com/docs/eloquent
Laravel 5.x/6.x
Install the package:
Optionally (if you want to use default migrations):
If you use Laravel 5.4 or less,
or 5.5+ with package discovery disabled,
add the PredefinedMigrationsServiceProvider service provider config/app.php
:
then you can execute command:
Available classes
Entity
Extends Eloquent model, adds:
- Ability to set default field values for newly created inheritors
Example:
now if you create new user it will have role 'user' by default, if you don't provide it explicitly:
SortByName
Global scope for Eloquent models to add sorting by name by default
Example:
CamelCaseModel
Extended class Model for use camel case notation in DB.
Example:
CamelCaseForeignKeys trait
Use in any model class for get the default foreign key name for this model.
By default, Eloquent gets foreign keys in snake case notation,
this trait swap notation to camel case like carModelId
instead of car_model_id
.
Use it if you already have foreign keys in camel case notation.
Example:
Contributing
See Code of Conduct, if you want to make contribution (pull request) or just build and test project on your own.
Resources
- Changes History
- Bug Tracker
- Authors
All versions of eloquent-custom with dependencies
illuminate/database Version ^5.4 || ^6.0
illuminate/notifications Version ^5.4 || ^6.0
illuminate/support Version 5.* || ^6.0
saritasa/php-common Version ^1.0