PHPackages                             corb/template-manager - 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. corb/template-manager

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

corb/template-manager
=====================

Template manager for laravel

v0.1(10y ago)074PHP &gt;=5.5.9

Since Mar 24Compare

[ Source](https://github.com/CORBmx/l5-template-manager)[ Packagist](https://packagist.org/packages/corb/template-manager)[ Docs](https://github.com/gabomarin/l5-template-manager.git)[ RSS](/packages/corb-template-manager/feed)WikiDiscussions Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

CORB TEMPLATE MANAGER
=====================

[](#corb-template-manager)

A database template compiler for laravel 5

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

[](#installation)

- Install as laravel project dependency

    `composer require corb/template-manager`
- Add service provider in providers array (config/app.php)

    `Corb\TemplateManager\TemplateManagerServiceProvider::class,`
- Publish vendor files

    `$ php artisan vendor:publish --tag=config`

This will create a config file named template-manager.php

Configuration file
------------------

[](#configuration-file)

- models

    The model property is an array containing Model Namespaces to access table columns.

    ```
    `'models' => [
            App\User::class
        ];
    `

    or

     `models => [
                  'App\User'
              ];
          `

    ```

    Why? If you want to implement a WYSIWYG edit maybe this option is useful.
- use\_routes

    If you want to use package routes to get available table fields set to true (default).

    `'use_routes' => true,`
- route Url of the route, default 'templates'

    `'route' => 'templates',`

    Ex: `localhost:8000/templates'` //This url return all the configured tables with its columns
- template\_table

    Name of the database table to be used, default 'templates'.

    `'template_table' => 'templates',`

    WARNING: This configuration is used to create database migration. If you have an older migration it will be useless, so maybe you want to delete the migrate (Need to improve this).

Template table
--------------

[](#template-table)

- Create migration

    `$ php artisan vendor:publish --tag=migrations`

    This command create a new database migration using configuration file. Remember previous warning!.
- Run migrate

    `$ php artisan migrate`

    And thats it, now store your templates.

Usage
-----

[](#usage)

### Compiling a template

[](#compiling-a-template)

Add the TemplateManager class to your code

`use Corb\TemplateManager\TemplateManager;`

Create a new TemplateManager object

`$template = new TemplateManager;`

Compile a new template

`$compiled_template  = $template->parse('test_template', $template_data)`

\##Example

##### Database template: test\_template

[](#database-template-test_template)

```
Hi {{$user->name}}.
Thanks to use corb template manager, if you need help
Click here.

```

##### Test code: routes.php

[](#test-code-routesphp)

```
use Corb\TemplateManager\TemplateManager;

Route::get('/', function () {
    $template   = new TemplateManager;
    $user       = new stdClass;
    $user->name = 'Foo';
    $help_link  = 'https://github.com/gabomarin/l5-template-manager';
    $data = [
        'user'      => $user,
        'help_link' => $date
    ];
    echo $template->parse('test_template', $data);
});

```

##### Result

[](#result)

```
Hi Foo.
Thanks to use corb template manager, if you need help Click here.

```

TemplateManager Methods
-----------------------

[](#templatemanager-methods)

##### getModels()

[](#getmodels)

- Get models found in config file
- Return array

    \[ "App\\User", "App\\Product", \]

##### getFields()

[](#getfields)

- Get table columns from config models
- Return array

    \[ "users": \[ "id", "name", "email", \], "products": \[ "id", "name", "category", "sku" \] \]

##### parse($slug, $data)

[](#parseslug-data)

- Parse a template
- Params:

    - $slug: template slug
    - $data: Array of data to be parsed in template -Return: A string of compiled template

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3751d ago

### Community

Maintainers

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

---

Top Contributors

[![gabomarin](https://avatars.githubusercontent.com/u/2908596?v=4)](https://github.com/gabomarin "gabomarin (1 commits)")

---

Tags

laraveltemplate

### Embed Badge

![Health badge](/badges/corb-template-manager/health.svg)

```
[![Health](https://phpackages.com/badges/corb-template-manager/health.svg)](https://phpackages.com/packages/corb-template-manager)
```

###  Alternatives

[brackets/admin-ui

Administration user interface template

29262.2k3](/packages/brackets-admin-ui)[leitsch/kirby-blade

Enable Laravel Blade Template Engine for Kirby 4 and Kirby 5

2110.1k](/packages/leitsch-kirby-blade)

PHPackages © 2026

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