PHPackages                             jordan-adams/presenter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jordan-adams/presenter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jordan-adams/presenter
======================

A simple framework-agnostic model presenter

1.0.0(11y ago)021MITPHPPHP &gt;=5.4.0

Since Jan 15Pushed 11y agoCompare

[ Source](https://github.com/JordanAdams/Presenter)[ Packagist](https://packagist.org/packages/jordan-adams/presenter)[ RSS](/packages/jordan-adams-presenter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

\##Presenter

[![build status](https://camo.githubusercontent.com/c197db64b78b2d08167415059fd86901f5f50868d8377faa6480796d493ea5b2/68747470733a2f2f7472617669732d63692e6f72672f4a6f7264616e4164616d732f50726573656e7465722e706e67)](https://travis-ci.org/JordanAdams/Presenter)

A simple framework-agnostic model presenter for php.

\####Setup

Just use the `PresentableTrait` and add a presenter property to your model

```
use JordanAdams\Presenter\Presenter;
use JordanAdams\Presenter\PresentableTrait;

class MyModel {

    use PresentableTrait;

    protected $presenter = 'MyPresenter';
    protected $firstName = 'Jordan';
    protected $surname   = 'Adams';

}

class MyPresenter extends Presenter {

    public function fullName() {
        return $this->model->firstName . ' ' . $this->model->surname; // Jordan Adams
    }

}
```

Alternatively, roll your own `presenter()` method

```
use JordanAdams\Presenter\Presenter;

class MyModel {

    protected $presenter = 'MyPresenter';
    protected $firstName = 'Jordan';
    protected $surname   = 'Adams';

    public function presenter() {
        return new $this->presenter($this);
    }

}

class MyPresenter extends Presenter {

    public function fullName() {
        return $this->model->firstName . ' ' . $this->model->surname;
    }

}
```

\####Usage

Access the presenter methods as expected

```
$model = new MyModel();
$model->presenter()->fullName() // Jordan Adams
```

Or use property style retrieval

```
$model->presenter()->fullName // Jordan Adams
```

The presenter will also fallback to a model property if available

```
$model->presenter()->firstName // Jordan
```

\####License

The MIT License (MIT)

Copyright (c) 2014 Jordan Adams

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4131d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6eb2fa3cab13c7fbad6f4e77f9afa1974f76ea716bb84c743e67345ebb50afe6?d=identicon)[JordanAdams](/maintainers/JordanAdams)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jordan-adams-presenter/health.svg)

```
[![Health](https://phpackages.com/badges/jordan-adams-presenter/health.svg)](https://phpackages.com/packages/jordan-adams-presenter)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M210](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M857](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
