/**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $data = array('title' => \Input::get('title'), 'slug' => \Unicode::make(\Input::get('title')), 'show' => \Input::get('show'), 'sort' => \Input::get('sort'));
     $this->album->update($id, $data);
     \Notification::success('UPDATED !');
     return \Redirect::route('admin.album.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $input = \Input::all();
     try {
         $this->validation->validate($input);
     } catch (FormValidationException $e) {
         return \Redirect::back()->withInput()->withErrors($e->getErrors());
     }
     $data = array('title' => \Input::get('title'), 'slug' => \Unicode::make(\Input::get('title')), 'parent_id' => \Input::get('parent_id'), 'show' => \Input::get('show'), 'sort' => \Input::get('sort'));
     $this->cate->update($id, $data);
     \Notification::success('UPDATED !');
     return \Redirect::route('admin.category.index');
 }
 public function addmoreAddition($post_id)
 {
     $array_modal_attr = \Input::get('modal_attr');
     $array_modal_attr_value = \Input::get('modal_attr_value');
     $data_arr = array();
     if (\Input::has('modal_attr') || \Input::has('modal_attr_value')) {
         foreach ($array_modal_attr as $k => $v) {
             $data_arr[] = new \Addition(array('key' => $v, 'slug' => \Unicode::make($v), 'value' => $array_modal_attr_value[$k]));
         }
     }
     $currentPost = $this->post->find($post_id);
     $currentPost->addition()->saveMany($data_arr);
     \Notification::success('Done !');
     return \Redirect::back();
 }
 public function docreateRole()
 {
     $pers = \Input::get('name_per');
     try {
         $this->validator->validate(\Input::all());
     } catch (FormValidationException $e) {
         return \Redirect::back()->withErrors($e->getErrors());
     }
     $data = array('name' => \Input::get('name_role'));
     $role = $this->role->createGet($data);
     $id_role = $role->id;
     $role_att = $this->role->find($id_role);
     // print_r($role_att);
     foreach ($pers as $k => $per) {
         $check_per = $this->pers->whereFirst('name', \Str::lower($per), array());
         if ($check_per == null) {
             $data = array('name' => \Str::lower($per), 'display_name' => \Unicode::make($per));
             $news[$k] = $this->pers->createGet($data);
         } else {
             $news[$k] = $check_per;
         }
         $role_att->attachPermission($news[$k]);
     }
     \Notification::success('Create Role with Permission');
     return \Redirect::back();
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function updatesanpham($sp_id)
 {
     if (!\Input::has('file')) {
         $img_path = \Input::get('img-bk');
         if (empty($img_path)) {
             $img_path = '/public/backend/img/image_thumbnail.gif';
         }
         $img_name = \GetNameImage::make('/', $img_path);
     } else {
         $ha = \Input::get('file');
         $img_path = str_replace($this->name_project, '', $ha);
         $img_name = \GetNameImage::make('/', $img_path);
     }
     $sanpham = $this->sanpham->find($sp_id);
     $sanpham->name = \Input::get('name');
     $sanpham->slug = \Unicode::make(\Input::get('name'));
     $sanpham->chatlieu = \Input::get('chatlieu');
     $sanpham->mausac = \Input::get('mausac');
     $sanpham->size = \Input::get('size');
     $sanpham->style = \Input::get('style');
     $sanpham->mota = \Input::get('mota');
     $sanpham->image_path = $img_path;
     $sanpham->image_name = $img_name;
     $sanpham->status = \Input::get('status');
     $sanpham->order = \Input::get('order');
     $sanpham->danhmuc_id = \Input::get('danhmuc_id');
     $sanpham->khuyenmai = \Input::get('khuyenmai');
     $sanpham->save();
     \Notification::success('UPDATED !');
     return \Redirect::route('admin.sanpham.index', \Input::get('danhmuc_id'));
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     if (!\Input::has('file')) {
         $img_path = \Input::get('img-bk');
         if (empty($img_path)) {
             $img_path = '/public/backend/img/image_thumbnail.gif';
         }
         $img_name = \GetNameImage::make('/', $img_path);
     } else {
         $ha = \Input::get('file');
         $img_path = str_replace($this->name_project, '', $ha);
         $img_name = \GetNameImage::make('/', $img_path);
     }
     $data = array('title' => \Input::get('title'), 'slug' => \Unicode::make(\Input::get('title')), 'content' => \Input::get('content'), 'image_path' => $img_path, 'image_name' => $img_name, 'status' => \Input::get('status'), 'order' => \Input::get('order'));
     $news = $this->news->find($id);
     $news->title = \Input::get('title');
     $news->slug = \Unicode::make(\Input::get('title'));
     $news->content = \Input::get('content');
     $news->image_path = $img_path;
     $news->image_name = $img_name;
     $news->status = \Input::get('status');
     $news->order = \Input::get('order');
     $news->save();
     \Notification::success('UPDATED !');
     return \Redirect::route('admin.tintuc.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     if (!\Input::has('file')) {
         $img_path = \Input::get('img-bk');
         if (empty($img_path)) {
             $img_path = '/public/backend/img/image_thumbnail.gif';
         }
         $img_name = \GetNameImage::make('/', $img_path);
     } else {
         $ha = \Input::get('file');
         $img_path = str_replace($this->name_project, '', $ha);
         $img_name = \GetNameImage::make('/', $img_path);
     }
     $danhmuc = $this->danhmuc->find($id);
     $danhmuc->title = \Input::get('title');
     $danhmuc->slug = \Unicode::make(\Input::get('title'));
     $danhmuc->mota = \Input::get('mota');
     $danhmuc->image_path = $img_path;
     $danhmuc->image_name = $img_path;
     $danhmuc->image_name = $img_path;
     $danhmuc->status = \Input::get('status');
     $danhmuc->order = \Input::get('order');
     $danhmuc->save();
     \Notification::success('UPDATED !');
     return \Redirect::route('admin.danhmuc.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     if (!\Input::hasFile('img')) {
         $img = \Input::get('img_bk');
         $path_img = $img;
     } else {
         try {
             $this->valid->validate(\Input::all());
         } catch (FormValidationException $e) {
             \Notification::error('Please choose Image type: jpg, png, jpeg');
             return \Redirect::back()->withInput();
         }
         $img = \Input::file('img');
         $name = $img->getClientOriginalName();
         $path = 'public/upload/images/';
         $img->move($path, $name);
         $path_img = $path . $name;
     }
     $data = array('alt_text' => \Input::get('alt_text'), 'slug' => \Unicode::make(\Input::get('alt_text')), 'show' => \Input::get('show'), 'sort' => \Input::get('sort'), 'path_img' => $path_img);
     $this->image->update($id, $data);
     \Notification::success('UPDATED !');
     return \Redirect::back();
 }