]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Api/PageApiController.php
Started work on details/summary blocks
[bookstack] / app / Http / Controllers / Api / PageApiController.php
index f698627a7e8ac1f63e2d7aee1d60651b5a2f883d..6f3a71e029ba9b4bab542cb29c32a100dc5e6fac 100644 (file)
@@ -16,20 +16,20 @@ class PageApiController extends ApiController
 
     protected $rules = [
         'create' => [
-            'book_id'    => 'required_without:chapter_id|integer',
-            'chapter_id' => 'required_without:book_id|integer',
-            'name'       => 'required|string|max:255',
-            'html'       => 'required_without:markdown|string',
-            'markdown'   => 'required_without:html|string',
-            'tags'       => 'array',
+            'book_id'    => ['required_without:chapter_id', 'integer'],
+            'chapter_id' => ['required_without:book_id', 'integer'],
+            'name'       => ['required', 'string', 'max:255'],
+            'html'       => ['required_without:markdown', 'string'],
+            'markdown'   => ['required_without:html', 'string'],
+            'tags'       => ['array'],
         ],
         'update' => [
-            'book_id'    => 'required|integer',
-            'chapter_id' => 'required|integer',
-            'name'       => 'string|min:1|max:255',
-            'html'       => 'string',
-            'markdown'   => 'string',
-            'tags'       => 'array',
+            'book_id'    => ['required', 'integer'],
+            'chapter_id' => ['required', 'integer'],
+            'name'       => ['string', 'min:1', 'max:255'],
+            'html'       => ['string'],
+            'markdown'   => ['string'],
+            'tags'       => ['array'],
         ],
     ];