Showing 10 of 2,133 results.

Laravel Macros: An Easy Way to Extend Laravel Components

Macros are a way to reduce the lines of code a developer has to write, and can be traditionally thought of as "shortcuts". Laravel generally uses macros to add, or inject, functions into various classes at runtime. Developers familiar with C# can...

Functions | Procedure vs. Function vs. Method vs. ?

Let's start with functions, because that will flow better with the previous examples. When we wrote our triangleArea function, that really was a function . Functions return a value to whatever code that called it. In our above example, some code...

findComponentsByTagName | Querying Document Nodes

Finds all components with the provided tag name. This method will return all component tags that match the provided name, including closing tags. Argument Description $tagName The tag name to filter on. 1 <?php 2 3 use Stillat \ BladeParser \...

fromText | Blade Documents

Constructs a new Document instance from the provided document text. The Document instance returned from this method is created by invoking DocumentFactory::makeDocument() . Argument Description $document The template content. $filePath An optional...

Laravel 5.5 String Helper Function: ascii

The ascii helper method accepts only one argument: $value . $value should always be a string, or something that can be cast into a string. The function converts a string in the UTF-8 encoding into its ASCII equivalent. This method is useful when...

Default Laravel Classes That Support Macros

The following Laravel classes allow for macros to be created by using the \Illuminate\Support\Traits\Macroable trait. There are, at the time of this writing, six classes that ship with direct support for macros: Class Description...

Laravel Collection Public API: sortByDesc

sortByDesc($callback, $options = SORT_REGULAR) The sortByDesc method operates exactly the same as the sortBy method. The only differences is that the sortByDesc method does not define a $descending parameter. The sortByDesc method internally makes...