If you have a table and there is no data in the table, and you want to show a default message like “No Data Found” to show users that data is not available in the database.
Let’s see an example, How to show a message if data is null in laravel when we have no data in a variable when we listed data in foreach loop.
I have a view file list.blade.php In this file, I listed all the packages in the blade file, here I applied a Condition, where I display an image if we have no data in our package table.