Sometimes we need just to make a line in a function
or callback and, Arrow Functions
in PHP. Came with version 7.4
we can do it easily without the full function.
Instead Of This
1Route::get('dashboard', function () {2 return view('dashboard');3});
Do This
1Route::get('/dashboard', fn () => view('dashboard'));
And you are good to go!
For more info check out php documentation