$input */ public function update(User $user, Team $team, array $input): void { Gate::forUser($user)->authorize('update', $team); Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], ])->validateWithBag('updateTeamName'); $team->forceFill([ 'name' => $input['name'], ])->save(); } }