Exemplo n.º 1
0
 /**
  * Update the specified pages in storage.
  * @param UpdatePagesRequest|Request $request
  *
  * @param  int  $id
  */
 public function update($id, UpdatePagesRequest $request)
 {
     $pages = Pages::findOrFail($id);
     $pages->update($request->all());
     return redirect()->route('admin.pages.index');
 }
Exemplo n.º 2
0
 /**
  * Supression d'une page
  */
 public function destroy($id)
 {
     $pages = Pages::findOrFail($id);
     $pages->delete();
     return redirect(action('PagesController@index'))->with('success', 'La page à bien été supprimé');
 }
Exemplo n.º 3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param int $id
  * @return Response
  */
 public function edit($id)
 {
     if (!File::isDirectory('uploads/' . $id)) {
         File::makeDirectory('uploads/' . $id);
         File::makeDirectory('uploads/' . $id . '/thumb');
     }
     $file = Files::where('pages_id', $id)->get();
     $page = Pages::findOrFail($id);
     $parentCategory = Pages::where('id', '!=', $id)->lists('name', 'id')->prepend('-- brak --', 0);
     $childs = Pages::where('pages_id', '=', $id)->orderBy('position', 'asc')->get();
     return view('admin.pages.edit')->with(['page' => $page, 'childs' => $childs, 'urlPath' => 'pages', 'title' => 'Edycja', 'file' => $file, 'parentCategory' => $parentCategory]);
 }