From 67bd7216549b230c4ce038d9af1a5856ba8dd1a5 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Thu, 13 Jul 2017 17:33:00 +0100 Subject: [PATCH] Get rid of temporary variable --- app/Http/Controllers/MicropubController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Http/Controllers/MicropubController.php b/app/Http/Controllers/MicropubController.php index 1afeb2db..f155548d 100644 --- a/app/Http/Controllers/MicropubController.php +++ b/app/Http/Controllers/MicropubController.php @@ -385,7 +385,6 @@ class MicropubController extends Controller } //check media valid if ($request->hasFile('file') && $request->file('file')->isValid()) { - $type = $this->getFileTypeFromMimeType($request->file('file')->getMimeType()); try { $filename = Uuid::uuid4() . '.' . $request->file('file')->extension(); } catch (UnsatisfiedDependencyException $e) { @@ -407,7 +406,7 @@ class MicropubController extends Controller $media = new Media(); $media->token = $request->bearerToken(); $media->path = $path; - $media->type = $type; + $media->type = $this->getFileTypeFromMimeType($request->file('file')->getMimeType()); $media->save(); return response()->json([