I am trying to define a global variable to use in multiple Laravel routes. However, I am getting "undefined variable $title" as error message. What am I doing wrong? The code on the bottom, throws a similar error.
$title = "YAAA";
Route::get('/insertORM', function(){
$a = $title;
});
This piece of code exists in a standard laravel application inside the routes/web.php file.