X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c6ad16dba657c82512ae495a4a38b99b8cfa9eeb..refs/pull/4191/head:/app/Http/Controllers/Api/ApiController.php diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php index 9652654be..5c448e49f 100644 --- a/app/Http/Controllers/Api/ApiController.php +++ b/app/Http/Controllers/Api/ApiController.php @@ -32,10 +32,15 @@ abstract class ApiController extends Controller */ public function getValidationRules(): array { - if (method_exists($this, 'rules')) { - return $this->rules(); - } + return $this->rules(); + } + /** + * Get the validation rules for the actions in this controller. + * Defaults to a $rules property but can be a rules() method. + */ + protected function rules(): array + { return $this->rules; } }