I just finished reading Request chapter. And I want to know how to get request input in route closure?
Create a object of Illuminate\Http\Request;
Route::get('/', function (Request $request) {
$request->all();
});
Or
Route::get('/', function () {
Illuminate\Support\Facades\Input::all();
});
You can use a global helper:
Route::get('/', function () {
request()->id;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With