guilhermegonzaga/presenter
Larablocks Analysis
guilhermegonzaga/presenter works with Laravel 5 to 13 (latest release 1.0.10, May 12, 2026).
Recommendation checks
Solid choiceSolid choice: maintained and up to date, meets 2 of 4 checks; below the bar for Recommended on use.
- Works with Laravel 13, the current version
- Released in the last 12 months (May 12, 2026)
- 2,856 downloads a month (needs 10,000)
- 46 GitHub stars (needs 100)
State
Maintained- Last stable release: May 12, 2026.
- 1 release in the last 12 months.
- First released: Jan 20, 2016.
- Monthly downloads: 2,856, down 31% from six months ago.
- 1 open issue on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 4, 2026.
| Install | |
|---|---|
composer require guilhermegonzaga/presenter |
|
| Latest Version: | 1.0.10 |
| PHP: | >=5.4.0 |
| Laravel: | 5 – 13 |
| License: | MIT |
| Last Updated: | May 12, 2026 |
| Links: | GitHub · Packagist |
Laravel Presenter
Presenter is a design pattern for Laravel which is used to modify the data that comes from your model to your views.
It causes the data to be displayed in a way understandable to humans.
Installation
Laravel (5.x|6.x|7.x|8.x|9.x|10.x|11.x|12.x)
Execute the following command to get the latest version of the package:
composer require guilhermegonzaga/presenter
Usage
The first step is to store your presenters somewhere - anywhere. These will be simple objects that do nothing more than format data, as required.
Note that your presenter class must extend Laracodes\Presenter\Presenter:
namespace App\Presenters;
use Laracodes\Presenter\Presenter;
class UserPresenter extends Presenter
{
public function fullName()
{
return $this->model->first_name . ' ' . $this->model->last_name;
}
public function accountAge()
{
return $this->model->created_at->diffForHumans();
}
...
}
Next, on your model, pull in the Laracodes\Presenter\Traits\Presentable trait, which will automatically instantiate your presenter class:
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Laracodes\Presenter\Traits\Presentable;
class User extends Model
{
use Presentable;
protected $presenter = 'App\Presenters\UserPresenter';
...
}
Done, now you can call it in your views:
<h1>Hello, {{ $user->present()->fullName }}</h1>
<h1>Hello, {{ $user->present()->full_name }}</h1> // automatically convert to camelCase
Notice how the call to the present() method (which will return your new or cached presenter object) also provides the benefit of making it perfectly clear where you must go, should you need to modify how a full name is displayed on the page.
Notices
When you call a method that does not exist in its class presenter, this package will automatically call the property in the model with conversion to snake_case.
Ex:
// automatically calls the property in the model
<h1>Hello, {{ $user->present()->firstName }}</h1> // automatically convert to snake_case
<h1>Hello, {{ $user->present()->first_name }}</h1>
Credits
This package is largely inspired by this great package by @laracasts.
Related Packages
Flexible Framework-Agnostic UI for Enterprise Web Applications
A package that makes it easy to add meta tags to your views. Includes easy Larav...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.0.10 | >=5.4.0 | >=5.0 | MIT | |
| 1.0.9 | >=5.4.0 | ^5.0| | MIT | |
| 1.0.8 | >=5.4.0 | ^5.0| | MIT | |
| 1.0.7 | >=5.4.0 | ^5.0| | MIT | |
| 1.0.6 | >=5.4.0 | ^5.0| | MIT | |
| 1.0.5 | >=5.4.0 | ^5.0| | MIT | |
| 1.0.4 | >=5.4.0 | ^5.0| | MIT | |
| 1.0.3 | >=5.4.0 | ~5.0| | MIT | |
| 1.0.2 | >=5.4.0 | ~5.0| | MIT | |
| 1.0.1 | >=5.4.0 | ~5.0 | MIT | |
| 1.0 | >=5.4.0 | ~5.0 | MIT |