Example #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return PaulVL\JsonApi\Response
  */
 public function destroy($id)
 {
     $class = $this->model_class;
     $response = new Response();
     $object = $class::findOrFail($id);
     try {
         $object->delete();
         return $response->response();
     } catch (Exception $e) {
         return $response->responseInternalServerError();
     }
 }