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

Laravel Blade X Laravel Package

spatie/laravel-blade-x

Blade-X brings Blade-style HTML components to Laravel 6 and below, letting you use tags like instead of @include. Package is abandoned because Laravel 7+ has native Blade components; migrate when upgrading.

View on GitHub
Deep Wiki
Context7

title: Sharing data with context weight: 2

By default BladeX components only have access to variables that are passed to them via attributes or via the view model. In some cases you might find yourself passing the same variables to multiple components. Take a look at this example where we are building a form using some BladeX components.

<input-field name="first_name" :model="$user" />

<input-field name="last_name" :model="$user" />

<input-field name="email" :model="$user" />

You can avoid having to pass $user to each component separatly by using a special component called context.

You can rewrite the above as

<context :model="$user">
    <input-field name="first_name" />

    <input-field name="last_name" />

    <input-field name="email" />
</context>

Note: If you are using a custom component prefix (e.g. BladeX::prefix('x'), for more details see the following chapter), you will have to use the prefix for this special component as well: <x-context :model="$user"></x-context>

The only restriction of context is that you shouldn't use it around a slot.

<model-form>
    {{-- Don't do this: the variables in `context` will not be passed to `$slot`.
    <context :model="$user">
        {{ $slot }}
    </context>
</model-form>
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport