Laravel str limit() function Example




Hi Guys,

In this limit blog,I will you how to use laravel str limit() function example. We will show example of limit function in laravel.The limit method truncates the given string to the specified length.

Here, The Str::limit method determines if a given string matches a given pattern. Asterlimitks may be used to indicate wildcards



namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Controllers\FileController;

use Illuminate\Support\Str;

class HomeController extends Controller



* Show the application dashboard.


* @return \Illuminate\Contracts\Support\Renderable


public function index()


$limit1 = Str::limit('The quick brown fox jumps over the lazy dog', 20);


// output - The quick brown fox...

$limit2 = Str::limit('This is Car',7);


// output - This is....




The quick brown fox...

This is....

It Will help you...

#Laravel 8

#Laravel 7


#Laravel 6