/** * Remove the specified resource from storage. * DELETE /admin\article/{id} * * @param int $id * @return Response */ public function destroy($id) { try { $article = Article::find($id); if ($article->delete()) { return Response::json(['message' => 'A(z) ' . $id . ' azonosítójú hír törlése sikerült!', 'status' => true]); } else { return Response::json(['message' => 'A(z) ' . $id . ' azonosítójú hír törlése nem sikerült!', 'status' => false]); } } catch (Exception $e) { if (Config::get('app.debug')) { return Response::json(['message' => $e->getMessage(), 'status' => false]); } else { return Response::json(['message' => 'A(z) ' . $id . ' azonosítójú hír törlése nem sikerült!', 'status' => false]); } } }
/** * Display the specified resource. * GET /site\article/{id} * * @param int $id * @return Response */ public function show($id) { $article = Article::find($id); View::share('title', $article->title); $this->layout->content = View::make('site.article.show')->with('article', $article)->with('url', Request::url()); }