示例#1
0
 /**
  * @param $id
  *
  * @dataProvider deleteOkProvider
  * @depends testUpdateOk
  */
 public function testDeleteOk($id)
 {
     $result = $this->repository->delete($this->repository->find($id));
     $this->assertTrue($result);
     $model = $this->repository->find($id);
     $this->assertNull($model);
 }
示例#2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  *
  * @return Response
  *
  * @apiDefine deleteDestroy
  * @apiName update
  * @apiErrorExample {json} Error-Response:
  *     HTTP/1.1 404 Not Found
  *     {}
  *
  * @apiErrorExample {json} Error-Response:
  *     HTTP/1.1 401 Not Authorized
  *     {}
  *
  * @apiName delete
  * @apiParam {Number} id Model unique ID.
  */
 public function destroy($id)
 {
     $this->addUserCriteria();
     $model = $this->repository->find($id);
     if (is_null($model)) {
         return response()->json([], 404);
     }
     $this->repository->delete($model);
     return response()->json([], 202);
 }