@addison
You can use the @empty
directive in Laravel Blade to display content if data is empty. Here's an example of how you can use it:
1 2 3 4 5 |
@if($data->isEmpty()) <p>No data available.</p> @else <p>Data is available.</p> @endif |
In this example, the isEmpty()
method is used to check if the data is empty. If the data is empty, it will display "No data available." Otherwise, it will display "Data is available."