abstract class ApiController extends Controller
{
protected $rules = [];
- protected $fieldsToExpose = [];
/**
* Provide a paginated listing JSON response in a standard format
* Get the validation rules for this controller.
* Defaults to a $rules property but can be a rules() method.
*/
- public function getValdationRules(): array
+ 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;
}
}