PHPackages                             ahmed1amen/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. ahmed1amen/db-blade-compiler

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

ahmed1amen/db-blade-compiler
============================

Render Blade templates from Eloquent Model Fields

v1(5y ago)08MITPHPPHP &gt;=5.3.0

Since Dec 10Pushed 5y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)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 flynsarmy/db-blade-compiler:1.*` directly):

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

```

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

```
'Flynsarmy\DbBladeCompiler\DbBladeCompilerServiceProvider',

```

and the Facade to the aliases array in the same file

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

```

You can also optionally publish the config-file

```
php artisan config:publish flynsarmy/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 flynsarmy/db-blade-compiler:2.*` directly):

```
"flynsarmy/db-blade-compiler": "*"

```

The DbBladeCompilerServiceProvider is auto-discovered and registered by default, but if you want to register it yourself:
add the ServiceProvider to the providers array in app/config/app.php

```
'Flynsarmy\DbBladeCompiler\DbBladeCompilerServiceProvider',

```

and the DbView facade is also auto-discovered, but if you want to add it manually:
add the Facade to the aliases array in config/app.php

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

```

You have to also publish the config-file

```
php artisan vendor:publish --provider="Flynsarmy\DbBladeCompiler\DbBladeCompilerServiceProvider"

```

### 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

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

1979d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47221870?v=4)[Ahmed Amen](/maintainers/ahmed1amen)[@ahmed1amen](https://github.com/ahmed1amen)

---

Top Contributors

[![ahmed1amen](https://avatars.githubusercontent.com/u/47221870?v=4)](https://github.com/ahmed1amen "ahmed1amen (3 commits)")

---

Tags

laravelmodeleloquentbladecompiler

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/ahmed1amen-db-blade-compiler/health.svg)](https://phpackages.com/packages/ahmed1amen-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)
