Navigate back to the homepage

Laravel change string case

Infinitbility
Laravel
May 4th, 2021 · 1 min read
keep affilitate

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;
2
3$converted = Str::title('a nice title uses the correct case');
4
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;
2
3$string = Str::ucfirst('foo bar');
4
5// Foo bar

Laravel uppercase

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

1use Illuminate\Support\Str;
2
3$string = Str::upper('infinitbility');
4
5// 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');
2
3// infinitbility

Thanks for reading…

Follow me on Twitter

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.

melio affilitate

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]

Guide book

Guidebook: The Javascript Monorepo Photoshop Guide

Tutorials

Categories

More articles from Infinitbility

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

how to handle No internet connection in React Native

May 2nd, 2021 · 1 min read
© 2020–2022 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]