PHPackages                             sebastiansulinski/blade - 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. sebastiansulinski/blade

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

sebastiansulinski/blade
=======================

Blade templates outside of laravel.

v2.1.1(6y ago)4225MITPHP ^7.2

Since Jul 1Compare

[ Source](https://github.com/sebastiansulinski/blade)[ Packagist](https://packagist.org/packages/sebastiansulinski/blade)[ RSS](/packages/sebastiansulinski-blade/feed)WikiDiscussions Synced today

READMEChangelogDependencies (3)Versions (7)Used By (0)

Blade
=====

[](#blade)

Package to allow you use blade templates outside of Laravel.

[![Build Status](https://camo.githubusercontent.com/02e4c4c2e2225d5bb3e1dd21f92867679c045f9081a255377cb7cff62921f1d1/68747470733a2f2f7472617669732d63692e6f72672f73656261737469616e73756c696e736b692f626c6164652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sebastiansulinski/blade)

### Usage instructions

[](#usage-instructions)

Blade constructor takes 4 arguments, 2 of which are optional:

```
$viewPaths: // either a string or array of paths where your views will be fetched from
$cachePath: // string representing the path to the cache directory (to store cached version of the views)
Container $app = null: // instance of the Illuminate\Container\Container (optional)
Dispatcher $events = null: // instance of the Illuminate\Events\Dispatcher (optional)
Filesystem $events = null: // instance of the Illuminate\Events\Filesystem (optional)
```

With new instance of the Blade class you can call the `view()` methods the same way as from within Laravel using [view()](https://laravel.com/docs/master/views) helper.

```
$blade = new Blade(
    realpath(__DIR__ . '/../resources/views'),
    realpath(__DIR__ . '/../resources/cache')
);
```

#### Passing variables

[](#passing-variables)

```
$user = User::find(1);

$blade->view('index', compact('user'));

$blade->view('index', ['user' => $user]);

$blade->view('index')->with('user', $user);
```

#### Determining if a view exists

[](#determining-if-a-view-exists)

```
$blade->view()->exists('test');
```

#### Sharing data with all views

[](#sharing-data-with-all-views)

```
$blade->share('user', $user);
```

#### View composers

[](#view-composers)

```
$blade->view()->composer('dashboard', function(View $view) {

    $user = new stdClass;
    $user->name = 'Martin';

    $view->with('user', $user);

});

$blade->view('dashboard');
// has instance of $user available
```

#### Blade vew template

[](#blade-vew-template)

Use blade view templates the same way as with [Laravel](https://laravel.com/docs/master/blade)

```
// index.blade.php

@extends('template.layout')

@section('content')

Hallo {{ $user->name }}

@endsection
```

#### Example

[](#example)

```
// /public/index.php

$blade = new Blade(
    realpath(__DIR__ . '/../resources/views'),
    realpath(__DIR__ . '/../resources/cache')
);

$user = User::find(1);

echo $blade->view('pages.index', compact('user'));

// /resources/views/template/layout.blade.php

DOCTYPE html>

    Title

        @yield('content')

// /resources/views/pages/index.blade.php

@extends('template.layout')

@section('content')

Hallo {{ $user->name }}

@endsection
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~267 days

Recently: every ~334 days

Total

6

Last Release

2313d ago

Major Versions

v1.0.2 → v2.0.02017-11-10

PHP version history (2 changes)v2.0.0PHP ^7.1

v2.1.0PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2211203?v=4)[Sebastian Sulinski](/maintainers/sebastiansulinski)[@sebastiansulinski](https://github.com/sebastiansulinski)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sebastiansulinski-blade/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M123](/packages/laravel-pulse)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[illuminate/view

The Illuminate View package.

13046.3M2.1k](/packages/illuminate-view)

PHPackages © 2026

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