Showing 10 of 1,278 results.

Laravel 5 Collections: The Public API

…le aggregate functions, along with many others. This section will cover most of the methods in the public API, excluding those methods required to implement PHP's ArrayAccess and IteratorAggregate interfaces, as well as the getCachingIterator...

Laravel 5: Array Helper Functions

Laravel provides many helper functions for interacting and manipulating array data structures. Laravel's array functions offer additional functionality on top of PHP's built in array functions. The helper functions in this section are located...

Laravel MessageBag Public API: has

…sageBag -> has ( ' test ' ) ; 10 11 // Add the message to the message bag. 12 $ messageBag -> add ( ' test ' , ' Example message ' ) ; 13 14 // true 15 $ hasMessage = $ messageBag -> has ( ' test ' ) ;This article is the start of a mini-series...

Laravel MessageBag Public API: getMessageBag

…?php 2 3 use Illuminate \ Support \ MessageBag ; 4 5 // false 6 $ isEqual = ( $ messageBag === $ anotherMessageBag ) ; 7 8 // true 9 $ isEqual = ( $ messageBag === $ messageBag -> getMessageBag ( ) ) ;This article is the start of a mini-series...

Laravel MessageBag Public API: toJson

…5 // Create a new MessageBag instance. 6 $ messageBag = new MessageBag ( [ ] ) ; 7 8 // Replace 512 with the desired depth. 9 $ jsonValue = json_encode ( $ messageBag -> jsonSerialize ( ) , 0 , 512 ) ;This article is the start of a mini-series...

Laravel MessageBag Public API: __toString

…the MessageBag into a string. 11 $ stringValue = ( string ) $ messageBag ; After the above code executes, the $stringValue variable would contain the following value: 1 {"first":["The first message"]}This article is the start of a mini-series...

Laravel MessageBag Public API: toArray

…3 ) 2 ' first ' => string ' I am first ' ( length = 10 ) 3 ' second ' => string ' I am second ' ( length = 11 ) 4 ' third ' => 5 array ( size = 1 ) 6 ' first ' => string ' I am nested ' ( length = 11 )This article is the start of a mini-series...

Laravel MessageBag Public API: all

…30 ) 3 1 => string ' The message was: Second Message ' ( length = 31 ) 4 2 => string ' The message was: Third Message ' ( length = 30 ) 5 3 => string ' The message was: Fourth Message ' ( length = 31 )This article is the start of a mini-series...

Laravel MessageBag Public API: getMessages

…( size = 2 ) 2 ' hello ' => 3 array ( size = 1 ) 4 0 => string ' The first message bag message ' ( length = 29 ) 5 ' world ' => 6 array ( size = 1 ) 7 0 => string ' The second message ' ( length = 18 )This article is the start of a mini-series...

Laravel MessageBag Public API: merge

…d contain a value similar to the following output: 1 array ( size = 2 ) 2 0 => string ' The username is required ' ( length = 24 ) 3 1 => string ' That username has already been taken ' ( length = 36 )This article is the start of a mini-series...