Skip to content

Commit

Permalink
Merge pull request #67 from Newman101/feature/last-bit-of-code-coverage
Browse files Browse the repository at this point in the history
Last Bit of Code Coverage
  • Loading branch information
jremes-foss committed Jun 30, 2021
2 parents 23b5059 + 8c59220 commit 2be9d33
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/Http/Controllers/ChallengesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,8 @@ public function addScore(Request $request)

public function download($id)
{
try {
$attachment = Attachment::where('challenge_id', $id)->first();
$storage_path = storage_path('app/' . $attachment->filename);
return response()->download($storage_path);
} catch (Exception $e) {
return abort(404);
}
$attachment = Attachment::where('challenge_id', $id)->first();
$storage_path = storage_path('app/' . $attachment->filename);
return response()->download($storage_path);
}
}

0 comments on commit 2be9d33

Please sign in to comment.