Skip to content

Tag: laravel-blade

Laravel Blade compileString gives me a Blank Page

I tried to create a new blade directive in my AppServiceProvider: And then call this directive in my view: @test() But it’s not work and gives me a blank page. Answer i try several things but finally i fix this by copy and paste blade directive code from BladeCompiler.php to my custom directive instead …

How to Set Variables in a Laravel Blade Template

I’m reading the Laravel Blade documentation and I can’t figure out how to assign variables inside a template for use later. I can’t do {{ $old_section = “whatever” }} because that will echo “whatever” and I don’t want that. I understand that I can do <?php $o…