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

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

flynsarmy/db-blade-compiler
===========================

Render Blade templates from Eloquent Model Fields

v9.0.2(2y ago)170882.5k↓19.2%38[8 issues](https://github.com/Flynsarmy/laravel-db-blade-compiler/issues)2MITPHPPHP &gt;=7.1

Since Dec 28Pushed 2y ago10 watchersCompare

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

READMEChangelog (10)DependenciesVersions (18)Used By (2)

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

46

—

FairBetter than 92% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity55

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity67

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

Recently: every ~421 days

Total

16

Last Release

880d ago

Major Versions

v1.0.2 → v2.0.02015-06-07

v2.0.2 → v3.0.02016-03-28

v3.0.0 → 5.4.02017-02-13

5.5.0 → v9.0.02022-03-19

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v9.0.0PHP &gt;=7.1

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/4594c8bcba5c2757ed536260d63b539bdf98c957bc56f58048cb92c3bfe4a2b1?d=identicon)[kguner](/maintainers/kguner)

---

Top Contributors

[![Flynsarmy](https://avatars.githubusercontent.com/u/334808?v=4)](https://github.com/Flynsarmy "Flynsarmy (27 commits)")[![dducro](https://avatars.githubusercontent.com/u/2156884?v=4)](https://github.com/dducro "dducro (15 commits)")[![jp-davy](https://avatars.githubusercontent.com/u/26009555?v=4)](https://github.com/jp-davy "jp-davy (4 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)")[![zfhassaan](https://avatars.githubusercontent.com/u/17079656?v=4)](https://github.com/zfhassaan "zfhassaan (2 commits)")[![hamway](https://avatars.githubusercontent.com/u/390578?v=4)](https://github.com/hamway "hamway (2 commits)")[![prajapatinirav](https://avatars.githubusercontent.com/u/7949561?v=4)](https://github.com/prajapatinirav "prajapatinirav (2 commits)")[![rozklad](https://avatars.githubusercontent.com/u/3017167?v=4)](https://github.com/rozklad "rozklad (2 commits)")[![AlexECP](https://avatars.githubusercontent.com/u/4592827?v=4)](https://github.com/AlexECP "AlexECP (2 commits)")[![zarianec](https://avatars.githubusercontent.com/u/3776001?v=4)](https://github.com/zarianec "zarianec (1 commits)")[![brandonjbegle](https://avatars.githubusercontent.com/u/22717872?v=4)](https://github.com/brandonjbegle "brandonjbegle (1 commits)")[![patrickhoogkamer](https://avatars.githubusercontent.com/u/1894838?v=4)](https://github.com/patrickhoogkamer "patrickhoogkamer (1 commits)")[![sburina](https://avatars.githubusercontent.com/u/10303819?v=4)](https://github.com/sburina "sburina (1 commits)")

---

Tags

laravelmodeleloquentbladecompiler

### Embed Badge

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

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

###  Alternatives

[shiftonelabs/laravel-cascade-deletes

Adds application level cascading deletes to Eloquent Models.

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

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

121137.5k](/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)
