PHPackages                             rickselby/laravel-auto-presenter-mapper - 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. rickselby/laravel-auto-presenter-mapper

AbandonedArchivedLibrary

rickselby/laravel-auto-presenter-mapper
=======================================

Define presenters in a service provider rather than in the model

v3.0.1(8y ago)45.5k1MITPHPCI passing

Since Mar 3Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/rickselby/laravel-auto-presenter-mapper)[ Packagist](https://packagist.org/packages/rickselby/laravel-auto-presenter-mapper)[ RSS](/packages/rickselby-laravel-auto-presenter-mapper/feed)WikiDiscussions main Synced 2mo ago

READMEChangelog (9)Dependencies (3)Versions (14)Used By (0)

Laravel Auto Presenter Mapper
=============================

[](#laravel-auto-presenter-mapper)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/e1233f71a8aaba195bba2e7a8058e3cd437786dd3acea7b4db7b8f6bec417e4b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7269636b73656c62792f6c61726176656c2d6175746f2d70726573656e7465722d6d6170706572)](https://camo.githubusercontent.com/e1233f71a8aaba195bba2e7a8058e3cd437786dd3acea7b4db7b8f6bec417e4b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7269636b73656c62792f6c61726176656c2d6175746f2d70726573656e7465722d6d6170706572)

This is an extension to the excellent [laravel-auto-presenter](https://github.com/laravel-auto-presenter/laravel-auto-presenter)that allows you to define presenters in a service provider or on-the-fly, rather than directly on the model.

Compatibility Chart
-------------------

[](#compatibility-chart)

Laravel Auto Presenter Mapper`laravel-auto-presenter`**3.x**7.x[2.x](https://github.com/rickselby/laravel-auto-presenter-mapper/tree/2.x)6.x[1.x](https://github.com/rickselby/laravel-auto-presenter-mapper/tree/1.x)5.xInstalling
----------

[](#installing)

Require the project using [Composer](https://getcomposer.org):

```
$ composer require rickselby/laravel-auto-presenter-mapper
```

Laravel 5.5+ will auto-discover the package.

For Laravel 5.1-5.4, you should only add this service provider, not the original `laravel-auto-presenter` service provider, as this one extends it.

In your `config/app.php` add this line to your 'providers' array...

```
RickSelby\LaravelAutoPresenterMapper\AutoPresenterMapperServiceProvider::class,
```

... and this line to your 'facades' array.

```
'Presenters' => \RickSelby\LaravelAutoPresenterMapper\Facades\AutoPresenterMapperFacade::class,
```

Usage
-----

[](#usage)

Read the docs at [github.com/laravel-auto-presenter/laravel-auto-presenter](https://github.com/laravel-auto-presenter/laravel-auto-presenter) for the basic use cases.

With this package, instead of altering your models to implement `HasPresenter`, you can define the presenters in a service provider using the facade. For example:

```
public function register()
{
    \Presenters::map(User::class, UserPresenter::class);
}
```

This will work exactly how the laravel-auto-presenter works; any `User` models passed to a view will be wrapped in `UserPresenter`.

The `map` function also takes an array:

```
public function register()
{
    \Presenters::map([
        User::class => UserPresenter::class,
        ...
    ]);
}
```

If you wish to declare a mapping on-the-fly, or override a mapping in a specific instance, the facade can be called from anywhere:

```
public function show(User $user)
{
    \Presenters::map(User::class, UserJSONPresenter::class);
    ...
}
```

### Decoratable

[](#decoratable)

To mimic the `Decoratable` interface of the parent package, you can call `decoratable`:

```
public function register()
{
    \Presenters::decorate(User::class);
    \Presenters::decorate([
        User::class,
        ...
    ]);
    ...
}
```

License
-------

[](#license)

Laravel Auto Presenter Mapper is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance49

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 92% of commits — single point of failure

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

Every ~43 days

Recently: every ~0 days

Total

11

Last Release

2920d ago

Major Versions

v1.1 → v2.02017-09-23

v2.2 → v3.02018-05-12

### Community

Maintainers

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

---

Top Contributors

[![rickselby](https://avatars.githubusercontent.com/u/1564517?v=4)](https://github.com/rickselby "rickselby (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rickselby-laravel-auto-presenter-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/rickselby-laravel-auto-presenter-mapper/health.svg)](https://phpackages.com/packages/rickselby-laravel-auto-presenter-mapper)
```

PHPackages © 2026

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