/** * Execute the console command. * * @return mixed */ public function handle() { $users = $this->userService->getUsers(); foreach ($users as $user) { echo 'GitHub name: ' . $user->github_name . " checking\n"; if (!$this->gitHubService->checkContribution($user->github_name)) { $this->yoService->sendYo($user->yo_name); \Log::info('GitHub name: ' . $user->github_name . ' is lazy person'); } } }
/** * Execute the console command. * * @param TwilioInterface $twilio * @param GitHubService $gitHubService * @param UserService $userService * @return mixed */ public function handle(TwilioInterface $twilio, GitHubService $gitHubService, UserService $userService) { $users = $userService->getUsers(); foreach ($users as $user) { if (!$gitHubService->checkContribution($user->name) && $user->phone_number !== 'tmp') { $twilio->call($user->phone_number, function ($message) { $message->play('http://saborunayo.sota1235.net/sounds/shinchoku.mp3', ['loop' => 2]); sleep(1); }); } } }