/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(SitioUpdateRequest $request)
 {
     $id_site = \Session::get('id_site');
     $sitio = Sites::find($id_site);
     $sitio->fill($request->all());
     $sitio->save();
     Session::flash('update', 'Cambios realizados exitosamente');
     return Redirect::to('/admin/contenidos');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(SitioUpdateRequest $request)
 {
     $sitio = Sitio::find(1);
     $sitio->name = $request->name;
     if ($request->hasFile('picture')) {
         $oldFile = $sitio->picture;
         $file = $request->file('picture');
         $destination_path = public_path() . '/file/';
         $name = 'sitio_' . time() . '.' . $file->getClientOriginalName();
         \Storage::disk('local')->put($name, \File::get($file));
         unlink($destination_path . $oldFile);
         $sitio->picture = $name;
     }
     $sitio->save();
     \Session::flash('success', 'Sitio actualizado exitosamente.');
     return redirect()->to('/admin/home');
 }