argument('user'); if(Str::contains($userId, '-')) $user = User::find($userId); else $user = User::findBySteamID($userId); if ($user === null) { $this->error('User id "' . $userId . '" not found'); return; } $playerData = $user->playerData(); $catalogItemIds = CatalogItem::all('id'); foreach ($catalogItemIds as $item) { try { $this->info('Attaching Item '.$item->id); $playerData->inventory()->attach($item->id); } catch(UniqueConstraintViolationException $e) { $this->warn('Skipping Item '.$item->id.'because it already is inside the players inventory.'); } } } }