Search

Showing 7 of 587 result(s)

/blog/2017/11/30/laravel-55-string-helper-method-kebab#content-example-use

Here are a few examples with the result above the function call in comments: The kebab helper method is simply a wrapper around the snake helper method. Calling kebab($value) is equivalent to calling snake($value, '-') .

/blog/2017/12/06/laravel-5-string-helpers-generating-random-strings#content-example-use

It should also be noted that the random method remove the following characters: Character / + = RuntimeException A RuntimeException will be thrown if a call is made to random without the OpenSSL extension installed. The following examples show...

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

We can combine this with PHP's built in range function for a simple way to check if a string ends in any alphabetical character:

/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#content-ranges

Laravel's translation components allow for a simple way to express ranges of numbers when defining language files; we've seen many of the ways to do this in previous sections. However, we will explore them again in this section.

/blog/2018/02/19/laravel-5-string-pluralization-syntax#content-creating-negative-ranges

We could also create a range for all numbers less than zero: The following table lists some sample input and output: Input Number Result -1 Less than zero 0 No items 2 Between one and three 3 Between one and three 4 Between four and six 6 Between...

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

If we look in the resources/lang/en/validation.php resource file, we will see something similar to the following defined at the top of the file: We can retrieve the accepted line like so: $translatedText = __('validation.accepted'); If the above...