예제 #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $page = Posts::find($id);
     if ($page) {
         $page = $page->delete();
     } else {
         $page = Posts::withTrashed()->find($id)->forceDelete();
     }
     return response()->json($page);
 }