/** * Execute the console command. * * @return mixed */ public function handle() { $accountModel = new Account(); $accounts = $accountModel->get(); $this->output->progressStart($accounts->count()); foreach ($accounts as $account) { $this->call('sync:groups', array('account_id' => $account->id)); $this->output->progressAdvance(); } $this->output->progressFinish(); $this->info("\n同步完成。"); }
public function get_accounts() { try { $user = auth()->user(); $accounts = Account::get($user); return view('/accounts', ["user" => $user, "accounts" => $accounts]); } catch (PDOException $e) { die($e->getMessage()); } }