X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a7a97a53f1d7b9e180d9296cec02c42d0a987a89..refs/pull/3068/head:/app/Http/Controllers/Api/ApiController.php diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php index b3f1fb747..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; + } +}