PHPackages                             dducro/db-blade-compiler - 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. [Database &amp; ORM](/categories/database)
4. /
5. dducro/db-blade-compiler

ActiveLibrary[Database &amp; ORM](/categories/database)

dducro/db-blade-compiler
========================

Render Blade templates from Eloquent Model Fields

3.1.0(9y ago)0369MITPHPPHP &gt;=5.3.0

Since Dec 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/dducro/laravel-db-blade-compiler)[ Packagist](https://packagist.org/packages/dducro/db-blade-compiler)[ RSS](/packages/dducro-db-blade-compiler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (12)Used By (0)

DB Blade Compiler
-----------------

[](#db-blade-compiler)

### Render Blade templates from Eloquent Model Fields

[](#render-blade-templates-from-eloquent-model-fields)

This package generates and returns a compiled view from a blade-syntax field in your Eloquent model.

### Installation (Laravel v &lt; 5)

[](#installation-laravel-v--5)

Require this package in your composer.json and run composer update (or run `composer require dducro/db-blade-compiler:1.*` directly):

```
"dducro/db-blade-compiler": "1.*"

```

After updating composer, add the ServiceProvider to the providers array in app/config/app.php

```
'dducro\DbBladeCompiler\DbBladeCompilerServiceProvider',

```

and the Facade to the aliases array in the same file

```
'DbView'          => 'dducro\DbBladeCompiler\Facades\DbView',

```

You can also optionally publish the config-file

```
php artisan config:publish dducro/db-blade-compiler

```

### Installation (Laravel 5.x)

[](#installation-laravel-5x)

Require this package in your composer.json and run composer update (or run `composer require dducro/db-blade-compiler:2.*` directly):

```
"dducro/db-blade-compiler": "2.*"

```

After updating composer, add the ServiceProvider to the providers array in app/config/app.php

```
'dducro\DbBladeCompiler\DbBladeCompilerServiceProvider',

```

and the Facade to the aliases array in the same file

```
'DbView'          => 'dducro\DbBladeCompiler\Facades\DbView',

```

You have to also publish the config-file

```
php artisan vendor:publish

```

### Usage

[](#usage)

This package offers a `DbView` facade with the same syntax as `View` but accepts a Model instance instead of path to view.

```
$template = Template::first();
return DbView::make($template)->with(['foo' => 'Bar'])->render();

```

Because you're passing a model to `DbView::make()`, db-blade-compiler needs to know which field to compile. By default this is `content` however you can set the field used with either of the following methods:

```
return DbView::make($template, ['foo' => 'Bar'], [], 'excerpt')->render();
return DbView::make($template)->field('excerpt')->with(['foo' => 'Bar'])->render();

```

You may set the default column used in the package config. You can enable using cache in compiling view from a blade-syntax field in your Eloquent model operation by enabling cache config in package config. By default this option is disabled.

### License

[](#license)

db-blade-compiler is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~113 days

Total

9

Last Release

3538d ago

Major Versions

v1.0.2 → v2.0.02015-06-07

v2.0.2 → v3.0.02016-03-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/39f0591e27f1ef54ac5218b2225dc2444899a6c316ab4fecbd6ba9c90e327243?d=identicon)[dducro](/maintainers/dducro)

---

Top Contributors

[![Flynsarmy](https://avatars.githubusercontent.com/u/334808?v=4)](https://github.com/Flynsarmy "Flynsarmy (14 commits)")[![dducro](https://avatars.githubusercontent.com/u/2156884?v=4)](https://github.com/dducro "dducro (12 commits)")[![cariboufute](https://avatars.githubusercontent.com/u/2434235?v=4)](https://github.com/cariboufute "cariboufute (4 commits)")[![ebrahimradi](https://avatars.githubusercontent.com/u/5802975?v=4)](https://github.com/ebrahimradi "ebrahimradi (3 commits)")[![hamway](https://avatars.githubusercontent.com/u/390578?v=4)](https://github.com/hamway "hamway (2 commits)")[![rozklad](https://avatars.githubusercontent.com/u/3017167?v=4)](https://github.com/rozklad "rozklad (2 commits)")

---

Tags

laravelmodeleloquentbladecompiler

### Embed Badge

![Health badge](/badges/dducro-db-blade-compiler/health.svg)

```
[![Health](https://phpackages.com/badges/dducro-db-blade-compiler/health.svg)](https://phpackages.com/packages/dducro-db-blade-compiler)
```

###  Alternatives

[flynsarmy/db-blade-compiler

Render Blade templates from Eloquent Model Fields

170866.2k2](/packages/flynsarmy-db-blade-compiler)[shiftonelabs/laravel-cascade-deletes

Adds application level cascading deletes to Eloquent Models.

163632.1k2](/packages/shiftonelabs-laravel-cascade-deletes)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121130.3k](/packages/highsolutions-eloquent-sequence)[phaza/single-table-inheritance

Single Table Inheritance Trait

1515.8k](/packages/phaza-single-table-inheritance)

PHPackages © 2026

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