mccool/laravel-auto-presenter
$user->presenter() calls). This improves readability and maintainability of view logic.View::composing or View::composed) to inject presenters transparently. Minimal changes to existing controllers/views.config/auto-presenter.php) or service provider bindings, giving flexibility for edge cases.View composer events may change).UserPresenter for User model). Custom naming may require extra config.laravel-presenter) with active support?Post model).@foreach($users as $user) → @foreach($users as $user) with $user->title now working via presenter).$users->toArray()).User->posts) are decorated correctly.composer require mccool/laravel-auto-presenter.php artisan vendor:publish --provider="McCool\AutoPresenter\AutoPresenterServiceProvider".config/auto-presenter.php.presenter() method caching), but this must be implemented manually.Arrayable).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Missing presenter class | Raw model returned to view | Config: default_to_raw_model = true |
| Presenter throws exception | View rendering fails | Global exception handler for presenters |
| Circular presenter references | Infinite loop, stack overflow | Depth limits in config or presenter logic |
| Laravel version incompatibility | Package fails to load | Fork/replace with custom solution |
| High memory usage | Slow responses, timeouts | Disable for APIs, optimize presenters |
| Race conditions in presenter caching | Inconsistent data | Use request |
How can I help you explore Laravel packages today?