arindam/blade-variable

A laravel package define variables in blade template

v1.0.0 2024-04-19 17:34 UTC

This package is auto-updated.

Last update: 2024-04-19 17:37:51 UTC


README

A laravel package define variables in blade template

Installation

No dependency on PHP version and LARAVEL version

STEP 1: Run the composer command:

composer require arindam/blade-variable

STEP 2: Laravel without auto-discovery:

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

In providers section

Arindam\BladeVariable\BladeVariableServiceProvider::class,

That's it!!, All Done! Now it ready to use

How to use it? How to declare a valiable in blade page?

//declare it
@var('myname', 'Arindam')

//use it
<h1>{{ $myname }}</h1>
//declare it
@var('myAge', 36)

//use it
<p>Age is : {{ $myAge }}</p>

license:

The MIT License (MIT). Please see License File for more information.

Post Issues: if found any

If have any issue please write me.