Ejemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $categories = Category::all();
     $article = Article::findOrFail($id);
     return view('easy.Admin.articles.edit', compact('categories', 'article'));
     //return view('easy.Admin.articles.edit')->withArticle(Article::find($id));
 }
Ejemplo n.º 2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $category = Category::findOrFail($id);
     $articles = $category->articles()->published()->orderBy('published_at', 'desc')->paginate(5);
     return view('easy.Application.category.index', compact('articles', 'category'));
 }