Last active
September 21, 2022 19:35
-
-
Save dperrymorrow/7f707033685b99e902dce7b411aea3bc to your computer and use it in GitHub Desktop.
how you dynamically pass helpers to blade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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