Some code simplifications.

This commit is contained in:
James Cole committed 2016-04-28 16:30:21 +02:00
1 parent e28e66e8f1
commit ea014a6504
5 files changed
+30 -25

No files matched your search

@@ -128,12 +128,13 @@ class AttachmentController extends Controller
*/
public function preview(Attachment $attachment)
{
if ($attachment->mime == 'application/pdf') {
$file = public_path('images/page_white_acrobat.png');
} else {
$file = public_path('images/page_green.png');
}
$image = 'images/page_green.png';
if ($attachment->mime == 'application/pdf') {
$image = 'images/page_white_acrobat.png';
}
$file = public_path($image);
$response = Response::make(File::get($file));
$response->header('Content-Type', 'image/png');