private function createCountryTranslations($translations) { foreach ($translations as $data) { $translation = new CountryTranslation(); $translation->country_id = $data['country_id']; $translation->locale = $data['locale']; $translation->name = $data['name']; $translation->save(); } }
public function test_it_does_not_delete_translations_while_force_deleting() { $country = CountryStrict::find(2); $country->forceDelete(); $after = CountryTranslation::where('country_id', '=', 2)->get(); $this->assertEquals(0, count($after)); }