Your view should not have blocks try/ catch. A view is that: a representation of some data. This means that you should not execute any logic (for example, exception handling). This belongs to the controller as soon as you select data from the models.
If you just need to display the default, if the variable is undefined, you can use the keyword or:
{{ $user->name or 'Name not set' }}
source
share