By 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.
#Signature
The signature of the getMessageBag
method is:
1public function getMessageBag();
#Example Use
The following example demonstrates the usage of the getMessageBag
method:
1use Illuminate\Support\MessageBag;
2
3// false
4$isEqual = ($messageBag === $anotherMessageBag);
5
6// true
7$isEqual = ($messageBag === $messageBag->getMessageBag());
∎