public function processSwitch() { $module = \Neyko\Admin\Model\AdminModule::where("name", "=", \Input::get("module"))->first(); $model = $module->model; $row = $model::find(\Input::get("id")); $field = \Input::get("field"); $row->{$field} = \Input::get("value"); $row->save(); return json_encode(array("success" => "true")); }
public function isParentOf($module) { return AdminModule::where("name", "=", $module)->where("parent", "=", $this->id)->count(); }