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