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);
 }
示例#2
0
 public static function getAllModules()
 {
     return ModvelModule::get();
 }