if ($request->hasFile('avatar')) { $file = $request->file('avatar'); // do something with the file }In this example, we are checking if the HTTP request contains a file input with the name "avatar." If it does, then we retrieve the file using the file() method and can perform any necessary actions on it (e.g. storing it in a database or on a server). The hasFile() method is part of the Laravel HTTP request object, which is included in the laravel/framework package.