PHPackages                             warrickbayman/looker - 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. [Templating &amp; Views](/categories/templating)
4. /
5. warrickbayman/looker

Abandoned → [thepublicgood/is-presentable](/?search=thepublicgood%2Fis-presentable)ArchivedLibrary[Templating &amp; Views](/categories/templating)

warrickbayman/looker
====================

A really simple PHP view presenter based on Jeffery Ways laracasts\\Presenter class

1.0.1(9y ago)03.1kMITPHP

Since Jun 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/warrickbayman/Looker)[ Packagist](https://packagist.org/packages/warrickbayman/looker)[ RSS](/packages/warrickbayman-looker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (5)Used By (0)

Looker
======

[](#looker)

[![Build Status](https://camo.githubusercontent.com/580e452438ce93175710589510713c3577b35fcf7017788997578322213c397f/68747470733a2f2f7472617669732d63692e6f72672f7761727269636b6261796d616e2f4c6f6f6b65722e737667)](https://travis-ci.org/warrickbayman/Looker)[![Stable](https://camo.githubusercontent.com/106533d1db4dd9c6f646d99e684f8160c39309b1965626ff5416782e8c60c4cf/68747470733a2f2f706f7365722e707567782e6f72672f7761727269636b6261796d616e2f6c6f6f6b65722f762f737461626c652e737667)](https://packagist.org/packages/warrickbayman/looker)[![Latest Unstable Version](https://camo.githubusercontent.com/b53ef97fa3678bfe3b247119d43e78d0710a8b734f55217c8180c4d7a4db38e6/68747470733a2f2f706f7365722e707567782e6f72672f7761727269636b6261796d616e2f6c6f6f6b65722f762f756e737461626c65)](https://packagist.org/packages/warrickbayman/looker)[![License](https://camo.githubusercontent.com/5417e411a12bcbbd841d696df733f325ef8983be281bde7215a87be2f175a53c/68747470733a2f2f706f7365722e707567782e6f72672f7761727269636b6261796d616e2f6c6f6f6b65722f6c6963656e7365)](https://packagist.org/packages/warrickbayman/looker)

A simple PHP presenter library.

Why
---

[](#why)

Well, it's quite common to separate your presentation code from your models. When I started with PHP I found myself doing things like:

```
//User.php

class User extends Model
{
    public function fullName()
    {
        return $this->first_name . ' ' . $this->last_name;
    }
}

// view.php

```

This is bad. So Looker separates your presentation stuff out of your models. It's based on the simple presentation library that Jeffery Way wrote for [Laracasts](https://laracasts.com).

Installation
------------

[](#installation)

Use composer:

```
composer require warrickbayman/looker

```

Usage
-----

[](#usage)

In your model add the `Looker\Presentable` trait:

```
use Looker\Traits\Presentable;

class User
{
    use Presentable;
}
```

Create a new view presenter that extends the `Looker\Presenter` class

```
use Looker\Presenter;

class User extends Presenter
{
    public function fullName()
    {
        return $this->entity->first_name . ' ' . $this->entity->last_name;
    }
}
```

Now, in your view:

```
echo $this->present()->fullName;
```

From within the presenter, `$this->entity` is the associated model.

By default, Looker will look in the `Http\Presenters` namespace for presenter classes, but you can change that. Somewhere in your intialization, call the `Looker::init` method and pass in the class path for your presenters:

```
Looker\Looker::init('Presenters');
```

You can also pass in a "suffix" if you like to do things like add the word "Presenter" to the end of your presenter classes:

```
Looker\Looker::init('Presenters', 'Presenter');
```

Now Looker will look for `UserPresenter` instead of just `User`.

Overriding Model Members
------------------------

[](#overriding-model-members)

Looker will automatically override model members. So you can do:

```
echo $user->present()->dateOfBirth;
```

even if the `dateOfBirth` method or property doesn't exist on your presenter. Looker will first look for a method by the same name on the model. If a method doesn't exist, it will then look for a property by the same name. Looker will throw a `OverrideFailed` exception if there is no method or property to call.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity66

Established project with proven stability

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 ~222 days

Total

4

Last Release

3320d ago

Major Versions

0.2.0 → 1.0.02015-11-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/89ea2dc12cd0a934de60705f8cfe47397095d842121b7d5f545dc9d1cee554ec?d=identicon)[warrickbayman](/maintainers/warrickbayman)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/warrickbayman-looker/health.svg)

```
[![Health](https://phpackages.com/badges/warrickbayman-looker/health.svg)](https://phpackages.com/packages/warrickbayman-looker)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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