public function delete($id)
 {
     $activity = ActivityModel::find($id);
     if (!$activity) {
         return response()->json(['message' => 'Activity with given id not found'], 404);
     }
     $activity->delete();
     return response()->json(['message' => 'Activity deleted'], 200);
 }
 public function testRunningMigration()
 {
     $activity = ActivityModel::find(1);
     $this->assertEquals('1', $activity->type_id);
 }
 public function test_it_empty_the_types_table()
 {
     (new Activity())->truncate();
     $this->assertEquals(0, ActivityModel::count());
 }
 /**
  * Truncates Table
  *
  * @return boolean
  */
 public function truncate()
 {
     DB::transaction(function () {
         ActivityModel::truncate();
     });
 }