Take your Eloquent Models to the next level
wendelladriel/laravel-lift is a Laravel package for take your eloquent models to the next level.
It currently has 702 GitHub stars and 49.190 downloads on Packagist (latest version v0.19.1).
Install it with composer require wendelladriel/laravel-lift.
Discover more Laravel packages by wendelladriel
or browse all Laravel packages to compare alternatives.
Last updated
[!WARNING] This is an experimental package!
You can install the package via composer:
composer require wendelladriel/laravel-lift
Add the Lift trait to models that should use typed public properties and Lift attributes:
use Illuminate\Database\Eloquent\Model;
use WendellAdriel\Lift\Attributes\Cast;
use WendellAdriel\Lift\Attributes\Fillable;
use WendellAdriel\Lift\Attributes\Rules;
use WendellAdriel\Lift\Lift;
final class Product extends Model
{
use Lift;
#[Fillable]
#[Rules(['required', 'string', 'max:255'])]
public string $name;
#[Fillable]
#[Cast('integer')]
#[Rules(['required', 'integer', 'min:0'])]
public int $stock;
}
Lift reads those attributes and applies the matching Eloquent configuration through model events. This keeps model behavior close to the property it describes while still using standard Eloquent models.
Access the full documentation here.
Please see the changelog for more information on what has changed recently.
Thank you for considering contributing to Lift! You can read the contribution guide here.
Please review our security policy on how to report security vulnerabilities.
Lift is open-sourced software licensed under the MIT license.