Category Archives: Laravel

Laravel Tutorials

Laravel str title() function Example

In this article, I’ll show you how to use laravel Str::title method with example. We will show example of laravel Str::title method in laravel. In this tutorial, we will use Str::title method to convert given string to title case.

Laravel Str::title method

The Str::title method converts the given string to Title Case String.

Example:-

Output:-

Laravel str studly() function Example

In this article, I’ll show you how to use laravel Str::studly method with example. We will show example of Str::studly method in laravel. In this tutorial, we will use Str::studly method to convert given string to Studly Case.

Laravel Str::studly method

The Str::studly method converts the given string to StudlyCase.

Example:-

Output:-

 

Laravel ucfirst() function Example

In this article, I’ll show you how to use laravel ucfirst() function with example. We will show example of ucfirst() function in laravel. In this tutorial, we will use ucfirst() function to convert given string to first character capitalized.

Laravel ucfirst() function

The ucfirst method returns the given string with the first character capitalized

Example:-

Output:-

Laravel substrCount() function Example

Laravel substrCount() function Example

In this article, I’ll show you how to use laravel substrCount() function with example. We will show example of substrCount() function in laravel. In this tutorial, we will use substrCount() function to count occurrences of a given value in the given string.

Laravel Str::substrCount method

The Str::substrCount method returns the number of occurrences of a given value in the given string

Example:-

Output:-

Laravel str pluralStudly() function 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:-

Output:-

Laravel str padRight() function Example

In this article, I’ll show you how to use laravel str padRight() function with example. We will show example of str padRight() function in laravel. In this tutorial, we will use str padRight() function to add padding to the right side of a string with another string until the final string reaches a desired length.

Laravel Str::padRight method

The Str::padRight method add padding to the right side of a string with another string until the final string reaches a desired length.

Example:-

Output:-

Laravel str contains() function Example

Laravel str contains() function Example

In this article, I’ll show you how to use laravel str contains() function with example. We will show example of str contains() function in laravel. In this tutorial, we will use str contains() function to check if a string contains any provided substring in it..

Laravel Str::contains() method

The Str::contains() method check if a string contains any substring in it. The Str::contains() method is str contains case insensitive.

Example:-

Output:-

How To Clear Route Cache In Laravel

How To Clear Route Cache In Laravel

In this How To Clear Route Cache In Laravel, I’ll show you how to clear route cache in laravel application. You’ll learn to clear route cache using artisan command as well as learn to clear laravel route cache on shared host from browser.

Clear Route Cache Using Artisan Command

To clear route cache in laravel use the php artisan route:clear artisan command as given below :

Laravel Clear Route Cache On Shared Host

Most of the times in shared hosting servers we don’t have SSH access to the server. In that case, to clear laravel route cache we have define a route in our application’s routes/web.php file that invoke the laravel clear route cache command. This way we can clear route cache by accessing specific routes in the browser.

Laravel str length() function Example

Laravel str length() function Example

In this article, I’ll show you how to use laravel str length() function with example. We will show example of str length() function in laravel. In this tutorial, we will use str length() to find the lenght of the provided string.

Laravel Str::length method

The Str::length method determines the length of the given string.

Example:-

Output:-

Laravel Arr first() function Example

Laravel Arr first() function Example

In this article, I’ll show you how to use laravel Arr first() function with example. We will show example of Arr first() function in laravel. In this tutorial, we will use Arr first() function to return first element of an array passing a given truth test.

Laravel Arr first() function

The laravel Arr first() function returns the first element of an array passing a given truth test.

Example:-

Output:-

Laravel Arr exists() function Example

Laravel array exists() function Example

In this article, I’ll show you how to use laravel array exists() function with example. We will show example of array exists() function in laravel. In this tutorial, we will use array exists() function to checks that the given key exists in the provided array.

Laravel Arr::exists method

The Arr::exists method checks that the given key exists in the provided array.

Example:-

Output:-

Laravel Arr pluck() function Example

Laravel array pluck() function Example

In this article, I’ll show you how to use laravel array pluck() function with example. We will show example of array pluck() function in laravel. In this tutorial, we will use array pluck() function to retrieves all of the values for a given key from an array.

Laravel Arr::pluck method

The Arr::pluck method retrieves all of the values for a given key from an array.

Example:-

Output:-