Laravel - Requests - File Paths Extensions

The UploadedFile class also contains methods for accessing the file's fully-qualified path and its extension. The extension method will attempt to guess the file's extension based on its contents. This extension may be different from the extension that was supplied by the client:

    
    $path = $request->photo->path();
    
    $extension = $request->photo->extension();