Search

Showing 7 of 1,216 result(s)

/blog/2017/12/06/laravel-5-string-helpers-getting-the-singular-form-of-a-string-value

The singular helper method is the logical opposite to the plural method: it will attempt to take a given $value and return the singular form of that word. The internal mechanisms are similar to the plural method.

/blog/2017/12/06/laravel-5-string-helpers-replacing-the-first-occurrence-of-a-value

The replaceFirst helper method is used to replace the first occurrence of a given $search string with the provided $replace string in the $subject string. All three parameters are required and must be strings.

/blog/2017/12/06/laravel-5-string-helpers-replacing-the-last-occurrence-of-a-value

The replaceLast helper method is the logical opposite of the replaceFirst helper method. It is used to replace the last occurrence of a given $search string with the provided $replace string in the $subject string. All three parameters are...

/blog/2017/12/06/laravel-5-string-helpers-uppercasing-the-first-word-of-a-value

The endsWith is used to check if a given $haystack ends with any of the supplied $needles . The $haystack is any value that can be cast into a string, and $needles is any value that can be cast into an array. If the $haystack ends with any of the...

/blog/2018/02/19/laravel-5-encoding-html-with-the-e-helper-function

The e function is a simple wrapper of PHP's htmlentities function. The e function utilizes the UTF-8 character encoding. The e function will sanitize user input when displaying it to the browser.

/blog/2018/02/19/laravel-5-string-pluralization-syntax

In the previous sections, we briefly explored the concept of pluralization in regards to translation lines. In this section, we will explore the pluralization syntax in greater detail and develop our pluralization skills a little more.

/blog/2018/02/19/laravel-5-translation-using-the-double-underscore-__-helper-function

The __ helper function can be used to retrieve lines of text from language files. You can retrieve lines of text from either key-based translation files (represented as PHP arrays) or from literal, string-based translation files (represented as a...