Skip to content
Advertisement

Call to undefined method stdClass::isEmpty() error

I am trying to check if the $pl1 is empty but it does not seems to work. I tried using count() but does not seems to work either.

controller:

JavaScript

blade.php:

JavaScript

Advertisement

Answer

The variable $paperlist1 is the Collection, so ->isEmpty() will only work on $paperlist1 and not on $pl1 as $pl1 is each value of the collection.

So, @if(!$pl1 -> isEmpty()) (that could be more readable if you used @if($pl1->isNotEmpty())) will not make sense at all, because you already have data.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement