In this tutorial you will learn about the Laravel str pluralStudly() function Example and its application with practical example.
Laravel str pluralStudly() function Example
In this article, I’ll show you how to use laravel str pluralStudly() function with example. We will show example of str pluralStudly() function in laravel. In this tutorial, we will use str pluralStudly() function to convert a singular word string formatted in studly caps case to its plural form.
Laravel Str::pluralStudly method
The Str::pluralStudly method converts a singular word string formatted in studly caps case to its plural form. This function currently only supports the English language.
Example:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<?php 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() { $pluralStudly1 = Str::pluralStudly('Verified Human'); echo $pluralStudly1."<br>"; $pluralStudly2 = Str::pluralStudly('User Feedback'); echo $pluralStudly2."<br>"; } } |
Output:-
1 2 |
Verified Humans User Feedback |