Download the PHP package znck/plug without Composer
On this page you can find all versions of the php package znck/plug. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package plug
Plug
A collection of pluggable Eloquent traits to enhance your Models.
Installation
Either PHP 7.0+ is required.
To get the latest version of Plug, simply require the project using Composer:
Instead, you may of course manually update your require block and run composer update
if you so choose:
Once Plug is installed, you can use the plug[gable] traits.
Usage
All features of Plug are provided as traits, so you can directly put them in you model class. Traits would automatically boot. No configuration is required.
Best practice is to create an abstract model class and use required plugs(traits).
Traits
-
BelongsToThrough
Inverse of HasManyThrough relation is missing from Eloquent. This plug (trait) providesbelongsToThrough
relationship. Under the hood, it usesBelongsToThrough
from [znck/belongs-to-through] package. -
FixBelongsTo
To maintain expected behavior ofbelongsTo
relation, Eloquent has introduced a bug. If model has non-incrementing primary key (ex: UUID) andbelongsTo
relation value is null, then if it is eager loaded, it would die due to SQL error. Issue 12051 -
FixForeignKey
Eloquent has misleading behavior when guessing foreign key field name. It takes lowercase singular name of model class and appends_id
to it, which is very counter-intuitive. Expected behavior is that it should guess foreign key field name from table name. Issue 10724 -
FixMorphTo
Relation classMorphTo
inheritsBelongsTo
, so it is prone to same bug. -
SelfDecorating@deprecated
It keeps database entries clean. For example: values inname
column should start with uppercase letter. -
SelfValidating@deprecated in favour of znck/repository
It validates attributes before saving or updating, hence only valid data goes in database. - UuidKey
It allows to usage of non-incrementing UUID primary keys.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email :author_email instead of using the issue tracker.
Credits
- Rahul Kadyan
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of plug with dependencies
illuminate/support Version ^5.2
illuminate/database Version ^5.2
illuminate/validation Version ^5.2
ramsey/uuid Version ^3.2
znck/belongs-to-through Version ^2.2