1{{Str::limit($category->name, 20)}}
2
3if to end
4
5{{Str::limit($category->name, 20, $end='.......')}}
6
7or
8
9{{\Illuminate\Support\Str::limit($category->name, 20)}}
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 !')