PHPackages                             doob-code/laravel-blade-snippets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. doob-code/laravel-blade-snippets

ActiveLibrary[Templating &amp; Views](/categories/templating)

doob-code/laravel-blade-snippets
================================

A very simple Blade directive to allow components and HTML to be rendered directly to a php variable from within a view.

v1.0.6(1y ago)010MITPHP

Since Oct 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/doob-code/laravel-blade-snippets)[ Packagist](https://packagist.org/packages/doob-code/laravel-blade-snippets)[ RSS](/packages/doob-code-laravel-blade-snippets/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

Laravel Blade Snippets
======================

[](#laravel-blade-snippets)

A simple Blade directive for Laravel that allows you to render components and HTML directly to a PHP variable from within a Blade view. This is particularly useful for passing dynamic content to Livewire components or other parts of your application.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require doob-code/laravel-blade-snippets
```

### Service Provider

[](#service-provider)

This package will automatically register its service provider, but if you need to do it manually, add the service provider to your `config/app.php` file:

```
'providers' => [
    // ...
    DoobCode\BladeSnippets\BladeSnippetServiceProvider::class,
],
```

Usage
-----

[](#usage)

### Defining Snippets

[](#defining-snippets)

Use the `@snip` and `@endsnip` directives to capture Blade components or HTML into a variable.

#### Example:

[](#example)

```
@snip('popoverContent')
    Dynamic section content here
@endsnip

@livewire('valuation.next-page-button', [
    'disabled_popover' => $popoverContent,
])
```

### Note on Variables

[](#note-on-variables)

When using the directives, make sure to provide a variable name without extra quotes. The directive automatically trims surrounding quotes.

License
-------

[](#license)

This package is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or enhancements.

Acknowledgments
---------------

[](#acknowledgments)

- Laravel framework
- Blade templating engine

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

7

Last Release

565d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0365291a4cbecdf93a3e1e396a1986c350ecb7a39ad16c2aa7630d0e085a9135?d=identicon)[doob-code](/maintainers/doob-code)

### Embed Badge

![Health badge](/badges/doob-code-laravel-blade-snippets/health.svg)

```
[![Health](https://phpackages.com/badges/doob-code-laravel-blade-snippets/health.svg)](https://phpackages.com/packages/doob-code-laravel-blade-snippets)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k454.7k15](/packages/robsontenorio-mary)[livewire/blaze

A tool for optimizing Blade component performance by folding them into parent templates

688221.3k17](/packages/livewire-blaze)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[rareloop/lumberjack-core

A powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code

42155.0k19](/packages/rareloop-lumberjack-core)[konekt/html

HTML and Form Builders for the Laravel Framework

24403.2k5](/packages/konekt-html)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
