systemPreference = SystemPreference::all(); return $this->systemPreference; } public function getByField($field,$value) { $this->systemPreference = SystemPreference::where($field,$value); return $this->systemPreference->get(); } public function store(Request $request, $value) { $this->systemPreference = SystemPreference::where([ ['name',$value['name']] ])->first(); $this->systemPreference->value = $value['value']; $this->systemPreference->updated_by = $value['updated_by']; if ($this->systemPreference->save()) { return true; } else { return false; } } public function update($name, $value) { $this->systemPreference = SystemPreference::where('name',$name)->first(); $this->systemPreference->value = $value; if ($this->systemPreference->save()) { return true; } else { return false; } } }