### Install Blade Capture Directive Source: https://github.com/ryangjchandler/blade-capture-directive/blob/main/README.md Installs the package via Composer. This is the initial step to integrate the directive into your Laravel project. ```bash composer require ryangjchandler/blade-capture-directive ``` -------------------------------- ### Basic Capture and Usage Source: https://github.com/ryangjchandler/blade-capture-directive/blob/main/README.md Demonstrates the basic usage of the @capture directive to capture a simple string and then echo it using a closure. ```blade @capture($hello) Hello, world! @endcapture {{ $hello() }} ``` -------------------------------- ### Run Tests Source: https://github.com/ryangjchandler/blade-capture-directive/blob/main/README.md Executes the project's tests using Composer. This is a standard command for verifying package functionality. ```bash composer test ``` -------------------------------- ### Capture with Arguments Source: https://github.com/ryangjchandler/blade-capture-directive/blob/main/README.md Shows how to capture Blade content that accepts arguments, allowing for dynamic output. The captured closure can be invoked with parameters. ```blade @capture($hello, $name) Hello, {{ $name }}! @endcapture {{ $hello('Ryan') }} ``` -------------------------------- ### Capture with Default Arguments Source: https://github.com/ryangjchandler/blade-capture-directive/blob/main/README.md Illustrates capturing Blade content with default argument values. This allows for more flexible invocation of the captured closure. ```blade @capture($hello, $name, $greeting = 'Hello, ') {{ $greeting }} {{ $name }}! @endcapture {{ $hello('Ryan') }} {{ $hello('Taylor', 'Yo, ') }} ``` -------------------------------- ### Inheriting Scope in Captured Blocks Source: https://github.com/ryangjchandler/blade-capture-directive/blob/main/README.md Demonstrates how captured blocks inherit the parent scope, allowing access to view data without explicit passing. Note that block parameters take precedence. ```blade @php($name = 'Ryan') @capture($hello) Hello, {{ $name }}! @endcapture {{ $hello() }} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.