Ejemplo n.º 1
0
 private function saveModules($data)
 {
     foreach ($data as $module) {
         Module::create(array('module_id' => $module['module_id'], 'module_name' => $module['module_name'], 'icon' => $module['icon']));
         foreach ($module['pages'] as $page) {
             Page::create(array('page_id' => $page['page_id'], 'module_id' => $module['module_id'], 'page_name' => $page['page_name'], 'page_url' => $page['page_url'], 'page_max_action' => $page['page_max_action'], 'icon' => $page['icon']));
             $permission = $page['permission'];
             Permission::create(array('group_id' => $permission['group_id'], 'module_id' => $module['module_id'], 'page_id' => $page['page_id'], 'action_value' => $page['page_max_action']));
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     Permission::create($request->only('code', 'name', 'description'));
     return redirect()->route($this->route);
 }