Exemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $product = Input::get('product', 0);
     $level = Input::get('level', 0);
     $details = Input::get('details', null);
     $detailsClass = Input::get('tabColor', 0);
     $image = Input::get('image', null);
     if ($product and $level) {
         $isShow = PhoneShow::where(['level' => $level])->first();
         if (!$isShow) {
             $show = new PhoneShow();
             $show->product_id = $product;
             $show->details = $details;
             $show->details_class = $detailsClass;
             // if ($details and $detailsClass) {
             //     $show->details = $details;
             //     $show->details_class = $detailsClass;
             // }
             $show->level = $level;
             $show->image = $image;
             if ($show->save()) {
                 return redirect('admin/show/show');
             }
         }
     }
     return redirect()->back();
 }