I'm not proud of this solution, but it works:
Blade::directive('carousel', function ($expression) {
$slug = trim($expression, "'");
return "<?php \$carousel = Carousel::with('slide')->where('slug', '=', '{$slug}')->first(); echo \$__env->make( 'www.common._partials.carousel' , ['carousel' => \$carousel])->render(); ?>";
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community