hemp/presenter
Hemp Presenter is a lightweight Laravel package for wrapping models or data in dedicated presenter classes, giving you a clean place for display formatting, computed fields, and view-ready output while keeping your models and controllers lean.
$model->present() and a class to hold display logic. Evaluating it is cheap; the decision it informs is whether formatting lives in models (accessors), controllers/resources, or a dedicated presenter.Consider it when:
app/Support).Look elsewhere when:
__get proxying on every attribute read can't be justified.Executives: This is an internal code-organization decision, not a product bet. It has no direct customer-visible impact; it either makes formatting-driven bugs cheaper to fix or adds a layer we don't need. Cost of trying is near zero: MIT license, tiny pattern, trivially replaceable. The question to fund is "team convention," not "vendor risk." Recommend a one-model pilot with a go/no-go in a sprint, not a platform initiative.
Engineering: hemp/presenter gives models a present() method returning a presenter class that proxies attributes to the model and exposes display methods — keeping currency, date, name, and status formatting out of Eloquent and out of Blade, and letting one model serve HTML, JSON, mail, and exports in different shapes. Caveat: 0 dependents and a single maintainer, so vendor the trait and base class rather than adding a Composer dependency — it's small enough to read and own in an afternoon, with attribution. Recommended stance: pilot on one model with multiple output channels; if duplication drops, standardize internally. If the actual requirement is typed DTOs or explicit API contracts, choose Laravel API Resources or spatie/laravel-data instead and skip this. Decision owner: engineering lead. Product's only stake is knowing which output surfaces must stay in sync and who owns formatting consistency when a field changes.
How can I help you explore Laravel packages today?