]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Controller.php
Allow to use DB tables prefix
[bookstack] / app / Http / Controllers / Controller.php
index 47b03b28d48aaa29610ef562635670af6adbb630..283a01cfb6a8852f23c0d73c9ef975189572492c 100644 (file)
@@ -4,7 +4,6 @@ namespace BookStack\Http\Controllers;
 
 use BookStack\Facades\Activity;
 use BookStack\Interfaces\Loggable;
-use BookStack\HasCreatorAndUpdater;
 use BookStack\Model;
 use finfo;
 use Illuminate\Foundation\Bus\DispatchesJobs;
@@ -16,7 +15,8 @@ use Illuminate\Routing\Controller as BaseController;
 
 abstract class Controller extends BaseController
 {
-    use DispatchesJobs, ValidatesRequests;
+    use DispatchesJobs;
+    use ValidatesRequests;
 
     /**
      * Check if the current user is signed in.
@@ -106,7 +106,7 @@ abstract class Controller extends BaseController
     /**
      * Send back a json error message.
      */
-    protected function jsonError(string $messageText = "", int $statusCode = 500): JsonResponse
+    protected function jsonError(string $messageText = '', int $statusCode = 500): JsonResponse
     {
         return response()->json(['message' => $messageText, 'status' => 'error'], $statusCode);
     }
@@ -118,7 +118,7 @@ abstract class Controller extends BaseController
     {
         return response()->make($content, 200, [
             'Content-Type'        => 'application/octet-stream',
-            'Content-Disposition' => 'attachment; filename="' . $fileName . '"'
+            'Content-Disposition' => 'attachment; filename="' . $fileName . '"',
         ]);
     }
 
@@ -130,9 +130,10 @@ abstract class Controller extends BaseController
     {
         $finfo = new finfo(FILEINFO_MIME_TYPE);
         $mime = $finfo->buffer($content) ?: 'application/octet-stream';
+
         return response()->make($content, 200, [
             'Content-Type'        => $mime,
-            'Content-Disposition' => 'inline; filename="' . $fileName . '"'
+            'Content-Disposition' => 'inline; filename="' . $fileName . '"',
         ]);
     }
 
@@ -162,6 +163,7 @@ abstract class Controller extends BaseController
 
     /**
      * Log an activity in the system.
+     *
      * @param string|Loggable
      */
     protected function logActivity(string $type, $detail = ''): void