Navigate back to the homepage

Laravel change string case

May 4th, 2021 · 1 min read
Laravel change string case

Hello Friends 👋,

Welcome To Infinitbility! ❤️

Laravel provide multiple methods to change string or text case, here you get example convert text into title, uppercase, lowercase, ucfirst ( first char capitalize ).

Let’s start today topic Laravel change string case or how to change text case in laravel

Table of content

  1. Laravel titleCase
  2. Laravel ucfirst
  3. Laravel uppercase
  4. Laravel lowercase

Laravel titleCase

Laravel provide Str::title() helper to create text in title case. in title case every first char of word are capitalize.

1use Illuminate\Support\Str;
3$converted = Str::title('a nice title uses the correct case');
5// A Nice Title Uses The Correct Case

Laravel ucfirst

Laravel provide Str::ucfirst() helper to create text or string in uc first case. basically ucfirst means first char of first word is capital.

1use Illuminate\Support\Str;
3$string = Str::ucfirst('foo bar');
5// Foo bar

Laravel uppercase

Laravel provide Str::upper() helpe to make text or string in uppercase.

1use Illuminate\Support\Str;
3$string = Str::upper('infinitbility');

Laravel lowercase

Laravel not provide any helper to make text or string in lowercase but php provide strtolower() method and we can also use in laravel.

1$string = strtolower('INFINITBILITY');
3// infinitbility

Thanks for reading…

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.


React Native


More articles from Infinitbility

Laravel query examples

Laravel query examples

Laravel CRUD ( create, retrieve, update, and delete ), and join query examples

May 3rd, 2021 · 1 min read
React native net info example

React native net info example

how to handle No internet connection in React Native

May 2nd, 2021 · 1 min read
© 2020–2021 Infinitbility
Link to $ to $ to $ to $ to $ to $mailto:[email protected]