filter()->create($request->all()); return response()->json([ 'data' => $data, 'message'=>'ok', 'status' => 200 ]); } /** * Show the specified resource. * @return Response */ public function show() { $data=Auth::user()->filter()->get(); return response()->json([ 'data' => $data, 'message'=>'ok', 'status' => 200 ]); } /** * Update the specified resource in storage. * @param Request $request * @return Response */ public function update(Request $request) { Filter::where('id',$request->id)->update($request->all()); $data=Filter::where('id',$request->id)->first(); return response()->json([ 'data' => $data, 'message'=>'ok', 'status' => 200 ]); } /** * Remove the specified resource from storage. * @param Request $request * @return Response */ public function destroy(Request $request) { Auth::user()->filter()->where('slug',$request->slug)->delete(); return response()->json([ 'data' => true, 'message'=>'ok', 'status' => 200 ]); } }