public function store(Request $request)
 {
     $postCategory = $request->get('postCategory');
     if ($postCategory == "create") {
         $moduleDetails = BaseHelpers::createModule($request->file('file'));
         $module = ModvelModule::create(['name' => $moduleDetails["name"], 'description' => $moduleDetails["description"], 'category' => $moduleDetails["category"], 'customer' => $moduleDetails["customer"], 'icon' => $moduleDetails["icon"], 'version' => $moduleDetails["version"], 'adminDisplayName' => $moduleDetails["adminDisplayName"], 'adminVisible' => $moduleDetails["adminVisible"], 'adminDisplayOrder' => 0, 'displayName' => $moduleDetails["displayName"], 'displayVisible' => $moduleDetails["displayVisible"], 'displayOrder' => $moduleDetails["displayOrder"]]);
         foreach ($moduleDetails as $k => $v) {
             if (is_array($v)) {
                 if ($v != []) {
                     foreach ($v as $key => $value) {
                         $detail = new ModvelModuleDetail();
                         $detail->moduleId = $module->id;
                         $detail->category = $k;
                         $detail->key = $key;
                         $detail->value = $value;
                         $detail->save();
                     }
                 }
             }
         }
         $datas = ModvelModule::get();
         return view("Modvel::admin." . $this->theme . ".modules.index")->with('datas', $datas)->with('headName', $this->headName);
     }
     $datas = ModvelModule::get();
     return view("Modvel::admin." . $this->theme . ".modules.index")->with('datas', $datas)->with('headName', $this->headName);
 }
Example #2
0
 public static function getModuleDetails($id)
 {
     return ModvelModuleDetail::where('moduleId', $id)->get();
 }
Example #3
0
 public function adminNavigationLinks()
 {
     $id = $this->attributes["id"];
     $links = ModvelModuleDetail::where('category', 'adminNavigationLinks')->where('moduleId', $id)->get();
     return $links;
 }