use Illuminate\Http\Request; Route::get('/welcome', function (Request $request) { $name = $request->input('name'); return view('welcome', ['name' => $name]); });
use Illuminate\Http\Request; Route::post('/upload', function (Request $request) { $file = $request->file('image'); $file->store('public/images'); return "File uploaded successfully!"; });In this example, we define a route that listens to incoming POST requests on the `/upload` endpoint. We use the `file` method of the `Request` object to retrieve the uploaded file. We then use the `store` method to store the file in a specific directory. Finally, we return a success message. Overall, the `illuminate/http` package library is a crucial part of Laravel's request handling capabilities, allowing developers to easily handle incoming HTTP requests and retrieve data from them.