Download the PHP package limanweb/eloquent-extensions without Composer
On this page you can find all versions of the php package limanweb/eloquent-extensions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download limanweb/eloquent-extensions
More information about limanweb/eloquent-extensions
Files in limanweb/eloquent-extensions
Download limanweb/eloquent-extensions
More information about limanweb/eloquent-extensions
Files in limanweb/eloquent-extensions
Vendor limanweb
Package eloquent-extensions
Short Description Extensions for Laravel Eloquent\Model
License MIT
Package eloquent-extensions
Short Description Extensions for Laravel Eloquent\Model
License MIT
Please rate this library. Is it a good library?
Informations about the package eloquent-extensions
limanweb/eloquent-extensions
Extensions for Laravel Eloquent\Model and other classes
- Trait HasUserstamps for filling userstamp fields
created_at
,updated_at
,deleted_at
by authorized user ID
Installation
Run:
Package contents
- /Models
- /Concerns
- HasUsertimestamps.php - trait for userstamps filling in model
- HasCompositePrimaryKey.php - trait for using in model composite primary key
- HasBuilderConfigurator - draft of trait to build queries with request params
Usage
HasUserstamps
Add into create or update table migration fields for userstamps created_at
, updated_at
and deleted_at
.
For examle modify CreateUsersTable migration.
In the model you must:
- declare using of trait Limanweb\EloquentExt\Models\Concerns\HasUserstamps
- use HasUserstamps trait in the model
- enable userstamps by define public property
$userstamps
withtrue
value
The created_by
and updated_by
fields in your model will now be populated in the same way as the timestamp fields when you create and update the model. If your model uses SoftDeletes traite, will also be processed field, deleted_by
.
HasCompositePrimaryKey
In the model you must:
- declare using of trait Limanweb\EloquentExt\Models\Concerns\HasCompositePrimaryKey
- use HasCompositePrimaryKey trait in the model
- set $incrementing model property as
false
- set $primaryKey model property as array complex primary key part names
Example of using
All versions of eloquent-extensions with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.2|^8.0
The package limanweb/eloquent-extensions contains the following files
Loading the files please wait ....