/**
  * @param string $filename
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postEdit($filename)
 {
     $data = $this->request->all();
     $file = $this->getFile($filename);
     $file->fill(array_only($data, ['name', 'content', 'editor', 'roles']));
     $validator = $file->validator();
     if ($validator->fails()) {
         $this->throwValidationException($this->request, $validator);
     }
     $this->collection->saveFile($file)->saveSettings();
     return $this->smartRedirect(['name' => $file->getName()])->with('success', trans($this->wrapNamespace("{$this->sectionPrefix}.messages.updated"), ['name' => $file->getName()]));
 }
 public function postEdit()
 {
     $filename = $this->getRequiredParameter('name');
     $data = $this->request->all();
     $file = $this->getFile($filename);
     $file->fill(array_only($data, ['name', 'content', 'editor', 'roles']));
     $validator = $file->validator();
     if ($validator->fails()) {
         $this->throwValidationException($this->request, $validator);
     }
     $this->collection->saveFile($file)->saveSettings();
     $this->setMessage(trans($this->wrapNamespace("{$this->sectionPrefix}.messages.updated"), ['name' => $file->getName()]));
 }