X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/3113/head:/app/Http/Controllers/Api/ApiController.php diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php index 0a3d89453..3f049a08c 100644 --- a/app/Http/Controllers/Api/ApiController.php +++ b/app/Http/Controllers/Api/ApiController.php @@ -1,4 +1,6 @@ -toResponse(); } /** * 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; } -} \ No newline at end of file +}