Search

Showing 7 of 1,216 result(s)

/blog/2018/02/19/laravel-5-encoding-html-with-the-e-helper-function#content-example-use

Let's assume that a malicious user was posting on a forum and set the subject of their post to this: <script>alert("hello everyone");</script> If the forum software did not sanitize user output, perfectly valid JavaScript code would be sent to the...

/blog/2018/02/19/laravel-5-encoding-html-with-the-e-helper-function#content-working-with-htmlable-values

The e helper function will encode the HTML characters within a string value, but treats instances of "Illuminate\Contracts\Support\Htmlable" differently in that it will not encode the HTML characters in the Htmlable instance's toHtml() return...

/blog/2018/02/19/laravel-5-string-pluralization-syntax#content-handling-specific-numbers

Sometimes it is useful to associate a given message number with exactly one number. In previous examples, we've seen how to handle the pluralization case where the number of items is exactly 0 , however, we can expand this idea to any arbitrary...

/blog/2018/02/19/laravel-5-string-pluralization-syntax#content-creating-a-range-between-two-numbers

To create a range between two numbers, enclose the range in square brackets ( [ and ] ) with the following format: [<LOWER_BOUNDS>,<UPPER_BOUNDS>] Where <LOWER_BOUNDS> is the lower bounds of the range, and <UPPER_BOUNDS> is the upper bounds of the...

/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-signature

The signature of the __ method is: The default value of $locale is null , which will indicate to the translation service the applications default locale should be used.