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