public function destroy($id) { $testCase = TestCase::find($id); if ($testCase) { TestCase::destroy($id); return $testCase; } else { return ['status' => 'error', 'message' => 'not found test case']; } }