search([])->map(function (NamiMemberEntry $member) use ($api) { return new CompleteMemberToRedisJob($api, $member->groupId, $member->id); })->toArray(); $batch = Bus::batch($jobs) ->finally(function (Batch $batch) { foreach (Redis::lrange('members', 0, -1) as $data) { ProcessRedisAction::dispatch(json_decode($data, true)); } }) ->onQueue('long') ->allowFailures() ->dispatch(); } public function asCommand(Command $command): int { $this->handle(app(NamiSettings::class)->login()); return 0; } }