/**
  * @param $name
  *
  * @return Account|null
  */
 protected function findAccount($name)
 {
     /** @var Account $account */
     foreach (Account::get() as $account) {
         if ($account->name == $name && $this->user->id == $account->user_id) {
             return $account;
             break;
         }
     }
     return null;
 }
Example #2
0
 /**
  * @param $name
  *
  * @return Account|null
  */
 protected function findAccount($name)
 {
     // account
     $user = User::whereEmail('*****@*****.**')->first();
     /** @var Account $account */
     foreach (Account::get() as $account) {
         if ($account->name == $name && $user->id == $account->user_id) {
             return $account;
             break;
         }
     }
     return null;
 }