_data['to'] = $to; } public function handle() { try { $response = $this->to->slackAPI()->getTeam($this->to->team_id); } catch (SlackTokenScopeException $e) { Log::error(sprintf('%s:%s',self::LOGKEY,$e->getMessage())); return; } // We need to refresh the team, in case their status has changed since the job was scheduled. $this->to->refresh(); $this->to->team_name = $response->domain; $this->to->description = $response->name; if ($this->to->isDirty()) Log::debug(sprintf('%s:Updated [%s] (%s)',self::LOGKEY,$this->to->id,$this->to->team_id),['m'=>__METHOD__,'changed'=>$this->to->getDirty()]); else Log::debug(sprintf('%s:No Update for [%s] (%s)',self::LOGKEY,$this->to->id,$this->to->user_id),['m'=>__METHOD__]); $this->to->save(); } }