public function language_created($lang_id) { $plist = \PersonModel::all(); foreach ($plist as $ent) { $item = new \PersonLangModel(); $item->person_id = $ent->id; $item->lang_id = $lang_id; $item->save(); } $glist = \PersonGroup::all(); foreach ($glist as $ent) { $item = new \PersonGroupLang(); $item->group_id = $ent->id; $item->lang_id = $lang_id; $item->save(); } }