Laravel str plural() function Example

Admin   Laravel   179  2021-03-15 13:40:05

In this tutorial, I will show you how to use laravel str plural() function. In this example We will learn str plural() function in laravel application.

The Str::plural method converts a single word string to its plural form. This function currently only supports the English language:

Here I will give you simple and easy example for str plural() function in laravel application.




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()


$plural1 = Str::plural('boy');


// output - boys

$plural2 = Str::plural('car');


// output - cars

$plural3 = Str::plural('child');


// output - children



Output :





It will help you...