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
You can use in Blade functionality for checking isset i.e
{{ $checkvariable or 'not-exist' }}
https://laravel.com/docs/5.2/blade#displaying-data