Laravel Blade Capture Directive is a fantastic package that introduces a new @capture directive that allows you to capture small parts of your Blade templates and re-use them later on without needing to extract them into partials. This package adds a new pair of directives: @capture and @endcapture. The @capture directive will capture all of your Blade until it reaches an @endcapture directive.
The above code will invoke your captured Blade code and output Hello, world!
This means you can assign default values and specify multiple arguments: @capture($hello, $name, $greeting = 'Hello, ') {{ $greeting }} {{ $name }}!