PHPackages                             nickyx3/blitz - 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. nickyx3/blitz

ActiveLibrary

nickyx3/blitz
=============

Laravel Blitz View (Blitz Extension TemplateEngine by Alexey Rybak, https://github.com/alexeyrybak/blitz)

1.1.0(3y ago)048MITPHPPHP &gt;=8.0

Since Aug 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/NickyX3/laravel-blitz-view)[ Packagist](https://packagist.org/packages/nickyx3/blitz)[ RSS](/packages/nickyx3-blitz/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (13)Used By (0)

Laravel Blitz View Package
==========================

[](#laravel-blitz-view-package)

Facade for Blitz template PHP extensions.

Required
--------

[](#required)

- Blitz extension ()
- If you want use Redis for cache compiled templates may required  extension or  class Redis cache type use Laravel Redis Facade, configured in your redis config.

Default cache type is "file", prepared templates store into laravel "storage/blitz\_compiled" folder (may change in config). By default, caching is disabled, you may change "cache\_enabled" to "true" in "config/blitz.php"

Installation For Laravel
------------------------

[](#installation-for-laravel)

Require this package with Composer

```
$ composer require nickyx3/blitz
```

Then run

```
$ php artisan vendor:publish --provider="NickyX3\Blitz\Providers\BlitzServiceProvider"
```

Configuration
-------------

[](#configuration)

Default configuration

```
    'templates_folder'      => 'blitz_view',
    'cache_type'            => 'file',
    'cache_enabled'         => false,
    'compiled_folder'       => 'blitz_compiled',
    'scope_lookup_limit'    => 8,
    'php_callbacks_first'   => 1,
    'namespace_finder'      => [
        'App\Helpers',
        'Illuminate\Support',
        'Illuminate\Support\Facades'
    ]
```

### Config parameters

[](#config-parameters)

- **templates\_folder** - where source templates relative to laravel resources folder
- **cache\_type** - 'file' or 'redis', default 'file'
- **cache\_enabled** - enabled or disabled caching, default 'false'
- **compiled\_folder** - where store cache relative to laravel storage folder, also if cache type 'redis' redis key is full path to compiled file in filesystem like 'file' cache type
- **scope\_lookup\_limit** - blitz extension ini parameter
- **php\_callbacks\_first** - blitz extension ini parameter
- **namespace\_finder** - in which namespace the template processor will look for classes specified in templates as callbacks. For example, you wrote in the template `Lang::get('DefaultTitle')`. The processor will find the first matching class in these namespaces and expand it into a fully qualified class name with a namespace (`Illuminate\Support\Facades\Lang::get('DefaultTitle')`). If the class is not found, then the callback will be deleted.

Usage
-----

[](#usage)

Example Controller

```
use NickyX3\Blitz\Facade\BlitzView;

Route::get('/', function () {
    return BlitzView::apply('example.blitz-extend',['title'=>'Blitz Title']);
});
```

Method `apply` returns `Illuminate\Http\Response`, also method `make` is alias for `apply`

Command
-------

[](#command)

The command is also available to clear the template cache

```
$ php artisan blitz:clear
```

### Exceptions

[](#exceptions)

If Blitz generate error, throw custom BlitzException with integrated renderer. This exception will be rendered if your env `APP_DEBUG=true`, otherwise simple laravel error 500 with abort helper.

Template Syntax Features
------------------------

[](#template-syntax-features)

Unlike Blitz, which can only do include, template "up" inheritance works like in Blade Engine. The following Blade directives are supported: `@yield`, `@extends`, `@section` and `@endsection` placed in an HTML comment tag. Also added Blade `@csrf` helper support, in HTML comment tag like `\`or direct `@csrf`

### Examples

[](#examples)

- "example/master.tpl" template

```
>

```

- "blitz-extend.tpl" template

```

this is template extends example/master.tpl

```

### How callbacks works?

[](#how-callbacks-works)

- Some Blitz directives like inline conditions with callbacks will be transform info full version, because callbacks not work in conditions

```
{{ if($title,$title,Lang::get('DefaultTitle')) }}
```

transform into

```
{{ IF $title }}{{ $title }}{{ ELSE }}{{ Illuminate\Support\Facades\Lang::get('DefaultTitle') }}{{ END if-title }}
```

- Full Blitz IF condition wth callback like this

```
{{ IF App::currentLocale()=='en' }}
    currentLocale: {{ App::currentLocale() }}
{{ ELSE }}
    currentLocale not 'en'
{{ END }}
```

will be transformed to this code in cached template

```
{{ IF Illuminate\Support\Facades\App::currentLocale()=='en' }}
    currentLocale: {{ Illuminate\Support\Facades\App::currentLocale() }}
{{ ELSE }}
    currentLocale not 'en'
{{ END }}
```

but after get "compiled" template all callbacks like that will be converted to variables on the fly

```
{{ IF $callback_83e69f8a22cc276d050d93f63c89a290=='en' }}
    currentLocale: {{ $callback_83e69f8a22cc276d050d93f63c89a290 }}
{{ ELSE }}
    currentLocale not 'en'
{{ END }}
```

where variable `$callback_83e69f8a22cc276d050d93f63c89a290` will be set result of eval `Illuminate\Support\Facades\App::currentLocale();`. If there are callbacks in the template that match the callbacks in the condition, they will also be replaced with this variable in order not to call the callback multiple times

Have fun!
---------

[](#have-fun)

Perhaps the code is not very good, I'm new to Laravel and also very poorly documented because I'm going on vacation. Maybe I'll make detailed comments later :-)

Additions and corrections welcome

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Every ~2 days

Total

12

Last Release

1348d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31e990c353ba263d727f0c7621250dd045ea03726b07a483de0231e701ed1940?d=identicon)[NickyX3](/maintainers/NickyX3)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/nickyx3-blitz/health.svg)

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

PHPackages © 2026

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