PHPackages                             ifnot/renderable - 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. ifnot/renderable

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

ifnot/renderable
================

Renderable is a PHP Presenter for Laravel, based on blade views for a final presentation of Eloquent models directly on your views.

2195PHP

Since Mar 16Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Renderable
==========

[](#renderable)

Renderable is a PHP Presenter for Laravel, based on blade views for a final presentation of Eloquent models directly on your views.

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

[](#installation)

Simply install the package with composer.

```
composer require ifnot/renderable
```

Register the package service provider into your `app.php` :

```
'Ifnot\Renderable\RenderableServiceProvider',
```

How it works ?
--------------

[](#how-it-works-)

A Renderable object is like a Presenter object but for returning views (complete or partial). If you are familiar with the Presenter pattern, you should understand easily Renderable mechanisms.

The main goal of this package is to provide witch view to use for rendering a model/property. This is very usefull if you want to include an model (or model property) in your view direcly without specifying the html witch definy him.

There are two aspects in this package :

- Property renderer
- Model renderer

Property Renderer (Basic setup)
-------------------------------

[](#property-renderer-basic-setup)

We have a `Page` Model (it could be Eloquent Model) and a `PageRenderer` (the Renderer class assigned for Page).

Page :

```
use Ifnot\Renderable\RenderableTrait;

class Page extends Eloquent {
  use RenderableTrait;
  public $renderer = 'PageRenderer';
}
```

PageRenderer :

```
use Ifnot\Renderable\Renderer;

class PageRenderer extends Renderer {
  public function title() {
    return $this->render($this->entity->title, 'page.property.title');
  }
}
```

And then, the `page.property.title` view:

```
{{ $property }}
```

Now you can call `$page->render()->title` into a regular view of your app:

```
  .. other stuff here ...

    {{ $page->render()->title}}

    This is another text, blah blah blah ...

  .. other stuff here ..
```

### Model Renderer (Basic setup)

[](#model-renderer-basic-setup)

Now ok, you want to render your whole model by itself, without specifying each properties. We have to add some configuration into `PageRenderer` :

PageRenderer :

```
use Ifnot\Renderable\Renderer;

class PageRenderer extends Renderer {
  public $renderable = [
    'model' => [
      'show' => 'page.model'
     ]
  ];

  // ...
  // Here, properties declaration (like title in the previous example)
  // ...
}
```

And then, the `page.model` view :

```

  {{ $entity->render()->title }}

  {{ $entity->content }}

```

Now you can call `$page->render()` into a view :

```
.. other stuff here ..

  {{ $page->render() }}

.. other stuff here ..
```

Advanced Setups
---------------

[](#advanced-setups)

- TODO : Write some lines about property binding
- TODO : Explain display mode usage ...

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/60343765?v=4)[ifnot](/maintainers/ifnot)[@ifnot](https://github.com/ifnot)

---

Top Contributors

[![IfnotFr](https://avatars.githubusercontent.com/u/1242308?v=4)](https://github.com/IfnotFr "IfnotFr (9 commits)")

### Embed Badge

![Health badge](/badges/ifnot-renderable/health.svg)

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

###  Alternatives

[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)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

555.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

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