Answers for "laravel trim string blade"

PHP
3

{{Str::limit laravel

{{Str::limit($category->name, 20)}}

if to end 
  
{{Str::limit($category->name, 20, $end='.......')}}
             
or
  
{{\Illuminate\Support\Str::limit($category->name, 20)}}
Posted by: Guest on December-05-2020
0

laravel trim string blade

#at AppServiceProvider

Blade::directive('trim', function ($string) {
            $string = urldecode($string);
            $string = trim($string);
            return "<?php echo $string; ?>";
        });

#And use on Blade template

@trim('Hello world !')
Posted by: Guest on March-17-2021
1

how to trim string in laravel

{{ \Illuminate\Support\Str::limit($productVal, 20, $end='...') }}
Posted by: Guest on July-01-2020

Browse Popular Code Answers by Language