AddressTrait, RolesTrait), but its narrow focus on Symfony (not Laravel) makes it non-applicable to Laravel projects. Laravel’s Doctrine/ORM ecosystem (if used) and Eloquent ORM differ fundamentally from Symfony’s Doctrine integration.spatie/laravel-model-states).protected properties instead of Doctrine’s @ORM\ annotations).__construct() patterns (e.g., no dependency injection via Symfony’s container).getAddress() vs. Eloquent’s getAttribute()).spatie/laravel-activitylog achieve the same goals with lower risk?@ORM\Column), which Laravel lacks.AddressTrait could be rewritten to use Laravel’s protected properties + accessors, but this is reinventing the wheel (Eloquent already handles this).Option 1: Abandon the Package
spatie/laravel-model-states).Option 2: Custom Laravel Port
@ORM\ annotations with PHP 8 attributes or manual property definitions.__construct() (e.g., no DI via Symfony’s container).use Illuminate\Database\Eloquent\Model;
class Foo extends Model {
use AddressTrait; // Custom Laravel-compatible version
}
Option 3: Hybrid Approach
class AddressHandler {
use AddressTrait; // Non-ORM usage
}
symfony/dependency-injection), which is overkill for Laravel.@ORM\ annotations; these would need removal or replacement.getAddress() could clash with Eloquent’s getAttribute() or getFillable().AddressTrait) in Laravel.setAddress()).protected properties work).symfony/dependency-injection) for non-ORM logic increases attack surface and build complexity.How can I help you explore Laravel packages today?