PHPackages                             strakez/betterblade - 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. strakez/betterblade

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

strakez/betterblade
===================

A port of Laravel 9's Blade::render functionality for previous versions

00PHP

Since Feb 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/strakers/betterblade)[ Packagist](https://packagist.org/packages/strakez/betterblade)[ RSS](/packages/strakez-betterblade/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

BetterBlade
===========

[](#betterblade)

A port of Laravel 9's inline blade rendering functionality for use with previous versions of Laravel. Currently this only supports v7.0+.

Please note that this package is intended for those who are not ready to upgrade their projects to Laravel 9 but wish to use the inline rendering. However, if you have time and resources to, I recommend installing/upgrading to Laravel 9 over using this package. (There's more to offer!)

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

[](#installation)

Using composer:

```
composer require strakez/betterblade
```

Setup/Discovery
---------------

[](#setupdiscovery)

The package setup should be autodiscovered after installation. If not, you can do one of the following steps:

### Setup via Script

[](#setup-via-script)

Run the autodiscover script manually:

```
php artisan package:discover
```

### Setup via Config File

[](#setup-via-config-file)

Manually include the following two lines in your `config/app.php` file:

- Under "Autoloaded Service Providers"

```
BetterBlade\BetterBladeServiceProvider::class
```

- Under "Class Aliases"

```
'BetterBlade'   =>  BetterBlade\BetterBladeFacade::class,
```

Usage
-----

[](#usage)

Use the facade `BetterBlade::render()` to render inline templates as strings.

```
$inlineTemplate = "Hello {{ $place }}. Wassup {{ $otherPlace }}!";

$replacementVariables = [
    'place' => "World",
    'otherPlace' => "Universe"
];

$string = BetterBlade::render($inlineTemplate, $replacementVariables);

echo $string;
// Hello World. Wassup Universe!
```

This follows the usage and functionality found in Laravel 9. For more on this, please visit .

Alternate Usage / Polyfill
--------------------------

[](#alternate-usage--polyfill)

Since the BetterBlade compiler extends the core Blade compiler, it is possible to override the Blade facade with BetterBlade while maintaining existing functionality. To do this, comment out the default reference in the `config/app.php` file, and add the following:

```
//'Blade' => Illuminate\Support\Facades\Blade::class,
'Blade' => BetterBlade\BetterBladeFacade::class,
```

Then, usage would be as follows:

```
$string = Blade::render($inlineTemplate, $replacementVariables);
```

This method works to polyfill the inline render functionality to the existing facade, ideally reducing code changes for future migrations to Laravel 9+. However, some may opt to keep this functionality separate from the default usages, so the choice is in your hands.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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://www.gravatar.com/avatar/59b0a077d0480dab9845c7b276c45c7fbe19d03c3ad37351162c11cd2f7befe7?d=identicon)[strakers](/maintainers/strakers)

---

Top Contributors

[![strakers](https://avatars.githubusercontent.com/u/6682857?v=4)](https://github.com/strakers "strakers (17 commits)")

### Embed Badge

![Health badge](/badges/strakez-betterblade/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

291.8k](/packages/webkinder-sproutset)[awkwardideas/switchblade

Extended blade directives for laravel

102.1k](/packages/awkwardideas-switchblade)

PHPackages © 2026

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