private function save() { $model = new RuleGroupModel(['name' => $this->name]); $model->save(); $this->dbid = $model->id; $this->model = $model; $this->saveRules(); }
public function rules() { $id = \Input::get('id'); $names = explode(',', \Input::get('names')); $result = RuleGroupModel::find($id); if ($result) { return $result->rules; } $result = RuleGroupModel::whereIn('name', $names)->get(); if ($result) { return $result; } return null; }