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.
Strengths:
string, int, CarbonImmutable), improving developer experience and runtime safety.Watch attribute enables fine-grained event handling per property, useful for observability or workflows (e.g., triggering notifications when price changes).Weaknesses:
casts, fillable), which may conflict with existing codebases or team preferences for explicit method definitions.protected $fillable, $casts, etc., in models.$fillable) as a backup.Rules attributes integrate with Laravel’s validation pipeline (e.g., Form Requests).Watch attribute enables granular event handling (e.g., pub/sub, workflows).Product, UserProfile) to test stability.$fillable with [Fillable] attributes.$casts to [Cast] attributes.Watch or Immutable for high-value models.$fillable) in parallel during migration.laravel-lift.wendelladriel.com for exact versions).CarbonImmutable) may require compatible DB drivers.spatie/laravel-model-states) may clash.laravel-debugbar, spatie/laravel-activitylog, etc.composer require wendelladriel/laravel-lift.use Lift; to target models.$fillable, $casts, etc., with attributes.ImmutablePropertyException).User model).dd($model->getCasts()) won’t show attributes).Cast attributes use the same syntax).ImmutablePropertyException) may be less intuitive than traditional Eloquent errors.CarbonImmutable) may require additional DB queries or serialization.memory_get_usage()).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Attribute parsing error | Model instantiation fails | Fallback to traditional methods |
| Immutable property violation | Runtime ImmutablePropertyException |
Validate in tests; use feature flags |
Event dispatch failure (Watch) |
Lost notifications/workflows | Retry logic or fallback to manual events |
| Database casting mismatch | Silent data corruption | Test with edge cases (e.g., NULL values) |
| PHP version incompatibility | Attributes ignored | Pin PHP version in composer.json |
castAndCreate vs create).Watch attributes).How can I help you explore Laravel packages today?