skip to Main Content

Laravel – Why larastan raise errors on array parameter definitions?

After I set in phpstan.neon parameter : level: 7 I got errors : 30 Method AppRulesItemModelRules::getValidationRulesArray() has parameter $skipFieldsArray with no value type specified in iterable type array. 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 30 Method AppRulesItemModelRules::getValidationRulesArray() return type has no value type…

VIEW QUESTION

Laravel – How to write a rule to pass the Larastan test

I'm struggling with the return code of a validation rule to pass the "Larastan" test. The code for this rule is: public function rules(): array { return [ 'name' => [ 'required', Rule::unique('domains', 'name')->where(function ($query) { return $query->where('organization_id', $this->route('organization')->id); })…

VIEW QUESTION
Back To Top
Search