sindyko/aliaser
Laravel package for elegant alias management across Eloquent models, Livewire forms, DTOs, collections, and enums. Use short aliases and the Entity facade (Entity::user(1)), auto-sync morph maps, and optimize Livewire snapshots with custom synthesizers.
App\Models\User) with short, intuitive aliases (e.g., user). This aligns with the principle of expressive code and reduces boilerplate in controllers, services, and Livewire components.commentable_type: 'post' instead of 'App\Models\Post'). This supports scalable architecture for apps with dynamic relationships (e.g., comments, attachments)./api/users → Entity::user()) and consistent serialization for GraphQL or REST APIs.aliaser:list, aliaser:help) reduces onboarding time.Avoid if:
Entity::user()) feels unnecessary for a small codebase.Consider if:
php artisan aliaser:list --json to quantify savings).Entity::user() over User::find() for semantic clarity).enforceMorphMap() calls.*"Aliaser is a low-risk, high-reward package that solves two critical pain points in our Laravel codebase:
App\Models\User) with short aliases (e.g., user), reducing cognitive load and speeding up development by 20–30% in controllers and Livewire components.*"Aliaser gives us:
Entity::user() instead of App\Models\User::find().php artisan aliaser:list --json.commentable_type becomes 'post' instead of 'App\Models\Post'.aliaser:list, aliaser:help) and programmatic registration make it easy to manage.
Downside: Minimal memory overhead (~50KB for 1000 aliases). Worth it for the readability and performance gains."**"This is a force-multiply for our dev team with minimal trade-offs:
How can I help you explore Laravel packages today?