route('school'); return [ 'name' => [ 'required', 'min:3', 'max:30', Rule::unique('schools', 'name')->ignore($schoolId), ], 'address' => ['required'], 'city' => ['required'], 'state' => ['required', 'min:2', 'max:2'], 'zip' => ['required', 'min:5', 'max:10'], ]; } public function authorize(): bool { if ($this->isMethod('post')) { return $this->user()->can('create', School::class); } if ($this->isMethod('patch')) { return $this->user()->can('update', $this->route('school')); } return false; } }