Skip to content

Instantly share code, notes, and snippets.

@dperrymorrow
Last active September 21, 2022 19:35
Show Gist options
  • Save dperrymorrow/7f707033685b99e902dce7b411aea3bc to your computer and use it in GitHub Desktop.
Save dperrymorrow/7f707033685b99e902dce7b411aea3bc to your computer and use it in GitHub Desktop.
how you dynamically pass helpers to blade
<?php
$blade->directive("sortHeader", function (...$args) {
$params = explode(",", $args[0]);
$output = call_user_func_array("sortHeader", $params);
die($output);
return "<?php echo $output; ?>";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment