Get collection in blade and check if empty If I want to display the addresses of a user in a blade file I do it like this:

@if(!$user-&gt;addresses-&gt;isEmpty())
  &lt;ul&gt;
  @foreach ($user-&gt;addresses as $address)
      &lt;li &gt;
      {!! displayText($address-&gt;toString()) !!}
      &lt;/li&gt;
  @endforeach
  &lt;/ul&gt;
@endif


If addresses would be an array instead of an collection I could shorten the code to:

@if(!empty($addresses = $user-&gt;addresses))
  &lt;ul&gt;
  @foreach ($addresses as $address)
      &lt;li &gt;
      {!! displayText($address-&gt;toString()) !!}
      &lt;/li&gt;
  @endforeach
  &lt;/ul&gt;
@endif


I wonder if there is a better way to check if a collection is empty in a blade file.
You don't need to check if your array is empty before using it in a foreach.

But if you need to check if it is empty (to show a message, for example), you can use the @empty tag. 

I'd do something like this: (Check also @forelse):

&lt;ul&gt;
  @forelse ($addresses as $address)
      &lt;li &gt;
      {!! displayText($address-&gt;toString()) !!}
      &lt;/li&gt;
  @empty($addresses)
      &lt;li&gt; No addresses... &lt;/li&gt;
  @endforelse
&lt;/ul&gt;