get(); return $details; } public function getMpin($customerNumber) { $this->mpin = MpinCodes::where([ 'customer_number' => $customerNumber ])->first(); return $this->mpin; } public function updateMpin($customerNumber,$data){ $this->mpin = MpinCodes::where([ 'customer_number' => $customerNumber ])->first(); $this->mpin->mpin_code = $data['mpin_code']; if ($this->mpin->save()) { return true; } else { return false; } } public function store($data) { $this->mpin = new MpinCodes; $this->mpin->customer_number = $data['customer_number']; $this->mpin->mpin_code = $data['mpin_code']; if ($this->mpin->save()) { return true; } else { return false; } } }