コード例 #1
0
 /** @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());
 }
コード例 #2
0
 /**
  * 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]);
 }