Blade::render() and @pushonce

45 Views Asked by At

I'm new to Laravel so it's quite possible that my problem stems from me.

I notice that when I call a component via the Blade ::render() facade, the component initializes correctly, but the code in this component between the @pushonce and @endpushonce directives is not added to the stack, as is the case when using this component from blade in the traditional way.

Here's an attempt to explain via code : In blade :​ <x-form.Input :bindHeader="$headers->name"></x-form.Input> ​Pushonce is ok

In php:​ Blade::render('<x-form.Input bindHeader="{{$item}}"></x-form.Input>', ["item", ="$headers->name"]); ​Pushonce is nok

Is there a workaround?

0

There are 0 best solutions below