]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Api/ApiController.php
Added webhook_call_before theme event hook
[bookstack] / app / Http / Controllers / Api / ApiController.php
index fc9788b06e340d405eb73b9d56fd5c1fb4290c5f..3f049a08c8afaba8523448137624b80dc078a0d1 100644 (file)
@@ -24,9 +24,14 @@ abstract class ApiController extends Controller
 
     /**
      * Get the validation rules for this controller.
+     * Defaults to a $rules property but can be a rules() method.
      */
     public function getValdationRules(): array
     {
+        if (method_exists($this, 'rules')) {
+            return $this->rules();
+        }
+
         return $this->rules;
     }
 }