/** * Get and inital group data that match with rule. * * @param null $default */ public function init($default = null) { //getGroupByRule $options['type'] = $this->type; $options['template'] = $this->template; $groups = $this->getGroupByRule($options); if (count($groups)) { foreach ($groups as $groupId) { $group = Group::find($groupId); $this->initGroup($group, $default); } } }
/** * @param Group $group * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function edit(Group $group) { $fields = $group->getListFields(); $locations = Rule::where('group_id', '=', $group->id)->get(); return view('dynamicfield::admin.group.edit', compact('group', 'fields', 'locations')); }