By John Koster
                                
                                                        
                        
                        
                    The has method can be used to determine if messages exist within the MessageBag instance for a given $key. The has method returns true if messages exist for the given $key, and returns false if no messages exist.
#Signature
The signature of the has method is:
1public function has(
2    $key
3);
The following examples demonstrate the usage of the has method:
 1use Illuminate\Support\MessageBag;
 2
 3// Create a new MessageBag instance.
 4$messageBag = new MessageBag;
 5
 6// false
 7$hasMessage = $messageBag->has('test');
 8
 9// Add the message to the message bag.
10$messageBag->add('test', 'Example message');
11
12// true
13$hasMessage = $messageBag->has('test');
∎