skip to Main Content

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