I\'m trying to create blade directive which echo variable (if variable defined) or echo \"no data\" if variable undefined.
This is my code in AppServiceProvider.ph
AppServiceProvider.ph
For Laravel 5.7 onwards use.
{{ $checkvariable ?? 'not-exist' }}