I would like to know what would be the best way to display a default value if the given value is not set. I have the following in a blade file (I can not guaranty that the k
I recommend setting the default value in your controller instead of making a work-around in your view.
This is the best way because it keeps logic out of your view, and keeps the view's markup clean.
For example in your controller, before passing data to the view:
if(!isset($foo['bar'])){
$foo['bar'] = 'baz';
}