I am using Laravel 8. I need a Global variable which will be available in all Views (Blade files).
This Global variable will update using some API call with every route call.
How can I create this Global Variable ?
You can define your global variables in AppServiceProvider in boot method:
public function boot()
{
$value = "myGlobal";
View::share('key', $value);
}
read this documentation : Sharing Data With All Views