By John Koster
The isNotEmpty
method returns a boolean value indicating if the MessageBag
instance actually has any messages. The method returns true
if the instance has messages, otherwise it returns false
. The isNotEmpty
method is an alias of the any
method.
#Signature
The signature of the isNotEmpty
method is:
1public function isNotEmpty();
#Example Use
The following method calls are equivalent:
1use Illuminate\Support\MessageBag;
2
3// Create a new MessageBag instance.
4$messageBag = new MessageBag;
5
6// false
7$hasAny = $messageBag->any();
8
9// false
10$isNotEmpty = $messageBag->isNotEmpty();
11
12$messageBag->addMessage('first', 'The first message');
13
14// true
15$hasAny = $messageBag->any();
16
17// true
18$isNotEmpty = $messageBay->isNotEmpty();
∎