]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Api/AttachmentApiController.php
Fixed occurances of altered titles in search results
[bookstack] / app / Http / Controllers / Api / AttachmentApiController.php
index 06d9f6907cae6633667c62c8816132c8db5e81f2..67815bc47bf4d47230a27787c7b50039cea06de9 100644 (file)
@@ -17,16 +17,16 @@ class AttachmentApiController extends ApiController
 
     protected $rules = [
         'create' => [
-            'name'        => 'required|min:1|max:255|string',
-            'uploaded_to' => 'required|integer|exists:pages,id',
-            'file'        => 'required_without:link|file',
-            'link'        => 'required_without:file|min:1|max:255|safe_url',
+            'name'        => ['required', 'min:1', 'max:255', 'string'],
+            'uploaded_to' => ['required', 'integer', 'exists:pages,id'],
+            'file'        => ['required_without:link', 'file'],
+            'link'        => ['required_without:file', 'min:1', 'max:255', 'safe_url'],
         ],
         'update' => [
-            'name'        => 'min:1|max:255|string',
-            'uploaded_to' => 'integer|exists:pages,id',
-            'file'        => 'file',
-            'link'        => 'min:1|max:255|safe_url',
+            'name'        => ['min:1', 'max:255', 'string'],
+            'uploaded_to' => ['integer', 'exists:pages,id'],
+            'file'        => ['file'],
+            'link'        => ['min:1', 'max:255', 'safe_url'],
         ],
     ];