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.
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui