Given the custom blade directive:
Blade::directive('svg', function ($expression) {
return "<?php echo public_path(\"img/{$expression}.svg\"); ?>";
});
Called by:
@svg('jason');
Yields an error due to the quotes appearing in the resulting PHP:
<?php echo public_path("img/'jason'.svg"); ?>
I feel like the wrapping quotes should have been removed for me… Do I need to remove them myself? Is there a better way?