Looking to hire Laravel developers? Try LaraJobs

brainlight-for-laravel maintained by brainlight

Description
Laravel support for Brainlight template engine.
Last update
2023/03/10 19:56 (dev-main)
License
Downloads
12

Comments
comments powered by Disqus

Brainlight for Laravel

Brainlight is a lightweight templating system with minimal logic pattern.

This is Laravel support for the Brainlight Php template engine.

Requirements

  • PHP >= 8.1
  • Laravel ^8.0|^9.0|^10.0

Installation

Require Brainlight for Laravel package in your Laravel project using the following command:

composer require brainlight/brainlight-for-laravel

By default, Brainlight for Laravel stores its cache in storage_path('brain'). If you don't plan to change this path, create a new brain directory in your storage folder.

Probably, you also want to create a .gitignore file in this new directory:

*
!.gitignore

Configuration

Publish the configuration file with the command:

php artisan vendor:publish --provider="BrainlightPhp\BrainlightForLaravel\BrainlightServiceProvider"

Then edit the configuration file that you've just created under: config/brainlight.php

Make reference to the Brainlight PHP documentation for options customization.

Usage

You can render Brainlight template files the same way as a Blade one:

return view('template', ['content' => 'Hello world.']);

template.brain:

<p>{{content}}</p>

Make reference to the Brainlight documentation for templates syntax.

License

Brainlight for Laravel is open-sourced software licensed under the MIT license