Download the PHP package laravel-ready/model-support without Composer
On this page you can find all versions of the php package laravel-ready/model-support. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-ready/model-support
More information about laravel-ready/model-support
Files in laravel-ready/model-support
Package model-support
Short Description Useful model support traits
License MIT
Informations about the package model-support
ModelSupport
📂 About
Useful eloquent model support traits.
📦 Installation
Get via composer
⚙️ Configs
Example Trait Usage
📝 Usage
HasLanguage
This trait allows you to get models by language.
Note Field name is
lang
by default. You can change it in the config file.
Sluggable
This trait allows you to generate a slug from a string. When you create a new model, the slug will be generated automatically. If you change the title, the slug will also be updated. See bootSluggable() method for more details.
Note Field names are
slug
andtitle
by default. You can change it in the config file.
SluggableTitle
This trait allows you to generate a slug from a title field. Same as Sluggable trait but it only works with the title field.
SluggableName
This trait allows you to generate a slug from a name field. Same as Sluggable trait but it only works with the name field.
ParentChild
This trait allows you to get all children of the model.
Note Field name is
parent_id
by default. You can change it in the config file.Warning It's only supports self-referencing models.
HasActive
This trait allows you to get active/inactive status models.
Note Field name is
is_active
by default. You can change it in the config file.Warning This trait forces your models to fillable
is_active
field and addsis_active
cast toboolean
.
⚓Credits
- This project was generated by the packager.