1#at AppServiceProvider
2
3Blade::directive('trim', function ($string) {
4 $string = urldecode($string);
5 $string = trim($string);
6 return "<?php echo $string; ?>";
7 });
8
9#And use on Blade template
10
11@trim('Hello world !')