Example #1
0
 public function postEdit(PageRequest $request)
 {
     $data = $request->all();
     if ($data['id']) {
         $page = $this->repository->update($data);
     }
     $response = ['errors' => [], 'data' => $page];
     return $response;
 }
Example #2
0
 /**
  * Update the specified page in storage.
  *
  * @param Page $page
  * @param PageRequest $request
  * @return Response
  */
 public function update(Page $page, PageRequest $request)
 {
     $page->fill($request->all());
     $page->save() ? Flash::success(trans('admin.update.success')) : Flash::error(trans('admin.update.fail'));
     return redirect(route('admin.page.index'));
 }