April 21, 2018 —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.
The signature of the isNotEmpty
method is:
1public function isNotEmpty();
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// false10$isNotEmpty = $messageBag->isNotEmpty();11 12$messageBag->addMessage('first', 'The first message');13 14// true15$hasAny = $messageBag->any();16 17// true18$isNotEmpty = $messageBay->isNotEmpty();
∎
The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.