Search

Laravel MessageBag Public API: getMessageBag

November 29, 2016 —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.

1<?php
2 
3use Illuminate\Support\MessageBag;
4 
5// false
6$isEqual = ($messageBag === $anotherMessageBag);
7 
8// true
9$isEqual = ($messageBag === $messageBag->getMessageBag());

#Continue Reading

This article is the start of a mini-series about Laravel's ErrorMessageBag component. Click through the rest of the articles to continue reading: