Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Blade Variable Laravel Package

arindam/blade-variable

Declare and use variables directly in Laravel Blade templates with a simple @var directive. Install via Composer (supports auto-discovery; provider available if needed) and set values like @var('name','Arindam') to access as $name in views.

View on GitHub
Deep Wiki
Context7

Laravel Blade Variable Declaration

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/graphviz
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata