/** * @param Request $request * @param Model|RetailerProduct $retailerProduct * * @return bool */ public function storeCoverage(Request $request, $retailerProduct) { $this->data = $request->all(); $user = $request->user(); try { $this->model = Header::create(['id' => date('U'), 'ad_user_id' => $user->id, 'ad_retailer_product_id' => $retailerProduct->id, 'op_client_id' => decode($this->data['client']), 'type' => 'Q', 'warranty' => true, 'currency' => $this->data['currency']['id'], 'term' => $this->data['term'], 'type_term' => $this->data['type_term']['id']]); return $this->saveModel(); } catch (QueryException $e) { } return false; }