store('uploads'); $originalFileName = $upload->getClientOriginalName(); $originalFileExtension = $upload->extension(); $originalFileSize = $upload->getSize(); $fileEntry = TeamFile::create([ 'uploaded_by' => $uploader, 'team_id' => $team, 'name' => $originalFileName, 'caption' => $caption, 'description' => $description, 'fs_location' => $file, 'extension' => $originalFileExtension, 'size' => $originalFileSize ]); if ($fileEntry && !is_bool($file)) { return $fileEntry; } throw new FileUploadException("There was an unknown error whilst trying to upload your file."); } }