Weave 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.
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table