/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Bookmark::where('id', $id)->where('user_id', Auth::user()->id)->delete(); Tag::where('bookmark_id', $id)->delete(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function show($id) { $user = Auth::user()->id; $bookmarks = Bookmark::where('user_id', '=', $user)->where('category_id', '=', $id)->get(); return Response::json($bookmarks, 200); }