April 21, 2018 —John Koster
The getMessageBag
method returns a reference to the MessageBag
instance. It exists to satisfy the requirements of the "Illuminate\Contracts\Support\MessageProvider" interface.
The signature of the getMessageBag
method is:
1public function getMessageBag();
The following example demonstrates the usage of the getMessageBag
method:
1use Illuminate\Support\MessageBag;2 3// false4$isEqual = ($messageBag === $anotherMessageBag);5 6// true7$isEqual = ($messageBag === $messageBag->getMessageBag());
∎