Laravel ucfirst() function Example
Teams applying “Laravel ucfirst() function Example” in a production project can use micromanaging your team dangers micromanagement avoid them to record implementation, review and debugging time, then compare that effort with tests and shipped functionality instead of treating activity as performance by itself.
Before copying the example into a live application, confirm version-specific behaviour with the official Laravel website and test it against the project’s actual database and runtime.
Hi Guys,
In this blog,I will you how to use laravel str ucfirst() function example. We will show example of ucfirst function in laravel.The ucfirst method returns the given string with the first character capitalized.
Here, I will give you full example for simply str ucfirst() method in laravel as bellow.
solution
$converted1 = Str::ucfirst('fooBar');
dd($converted1);
// output - Foo bar
$converted2 = Str::ucfirst('niceBlog');
dd($converted2);
//Nice Blog Example
<?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()
{
$converted1 = Str::ucfirst('fooBar');
dd($converted1);
// output - Foo bar
$converted2 = Str::ucfirst('niceBlog');
dd($converted2);
//Nice blog
}
}Output
"Foo bar"
"Nice blog" It Will help you...
# Laravel 8
# Laravel 7
# Laravel
# Laravel 6
- How to Notifications With database Driver in Laravel 11?
- How to Send Email Via Notification in Laravel 11?
- How to Install and Configure Laravel 11 Debugbar?
- How to Like Dislike System in Laravel 11?
- How to Paginate a Model with Relationship in Laravel 11?
- Laravel 11 Upload Files to Amazon S3 Example
- Laravel 11 Send WhatsApp Messages Example
- Laravel 11 Rest API Authentication Using JWT Tutorial