/** @test */ public function delete_property() { $propertyId = $this->getTestPropertyId(true); $this->call('DELETE', "/delete/{$propertyId}"); $this->assertResponseOk(); $this->seeJson(); $this->assertFalse(Property::where('id', $propertyId)->exists()); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $affect_rows = Property::where('id', '=', $id)->update(['status' => Category::getCategoryId('property.status', 'deleted')]); return response()->json(['status' => $affect_rows == 1 ? 0 : 2]); }