I am trying to write a custom directive in laravel. However, it only returns the path of my blade as a string, and not the actual html, e.g. @include.
@customInclude('authenticated/partials/header2') Blade::directive('customInclude', function($partial){ if(Config::get('constants.ORG_ID') === 'organizationId'){ return "<?php echo $partial; ?>"; } });
I want the user directive to return the html found in the path "authenticated / partials / header2", however, it seems that the blade server does not recognize that the path is the path in my php. My custom directive is in the AppServiceProvider.php file. Does anyone know how @include works very well, so they can explain why my path is not recognized.
source share