wendelladriel/laravel-lift
Experimental Laravel package that supercharges Eloquent models with typed public properties matching your schema, powered by PHP 8 attributes. Add validation rules and other metadata directly on models and access them via handy methods, using Eloquent events for easy drop-in use.
By default, when using the Lift trait, the model will ignore some public properties, that are "internal" properties,
by being handled by Lift.
If you want to add additional properties to be ignored, you can use the IgnoreProperties attribute:
use Illuminate\Database\Eloquent\Model;
use WendellAdriel\Lift\Attributes\Fillable;
use WendellAdriel\Lift\Attributes\IgnoreProperties;
use WendellAdriel\Lift\Attributes\PrimaryKey;
use WendellAdriel\Lift\Attributes\Rules;
use WendellAdriel\Lift\Lift;
#[IgnoreProperties('hash', 'hash2')]
final class Product extends Model
{
use Lift;
#[PrimaryKey]
public int $custom_id;
#[Rules(['required', 'string'], ['required' => 'The Product name can not be empty'])]
#[Fillable]
public string $name;
public string $hash;
public string $hash2;
}
How can I help you explore Laravel packages today?