示例#1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function postUpdate()
 {
     $input = Input::all();
     $input_array = (array) $input;
     $input_array['active'] = $input_array['active'] == 'true' || $input_array['active'] == 1;
     $doc_root = $_SERVER["DOCUMENT_ROOT"];
     if (Input::hasfile('file')) {
         $file = Input::file('file');
         $band = unlink($doc_root . "/" . $input_array['main_image']);
         $vector = explode("/banners/", $input_array['main_image']);
         $file->move($doc_root . "/photos/banners", $vector[1]);
     }
     return Flag::updateFlag($input_array);
 }