X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/04137e7c98cfe182f3c603e7d1acbc9a0ed524e7..8d7febe482f92a34093127c60c6e2dda342b4223:/app/Http/Controllers/Api/ApiController.php diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php index 4971c0cde..5d6f4a926 100644 --- a/app/Http/Controllers/Api/ApiController.php +++ b/app/Http/Controllers/Api/ApiController.php @@ -1,20 +1,38 @@ -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; + } +}