Ejemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $post = Post::find($id);
     $postCats = $post->categories;
     $ids = [];
     foreach ($postCats as $cat) {
         $ids[] = $cat->id;
     }
     return view('cms::admin.post.edit', ['post' => $post, 'ids' => $ids, 'categories' => Category::where('status', 1)->get()]);
 }