コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(PermissionRequest $request)
 {
     $input = $request->all();
     $permission = Permission::create($input);
     //Assign permissions to roles
     if (isset($input['roles_assg'])) {
         $permission->roles()->sync($input['roles_assg']);
     }
     Session::flash('flash_message', trans('admin/permissions.form.create_confirm'));
     return redirect()->back();
 }
コード例 #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(PermissionRequest $request)
 {
     $input = $request->all();
     //valores de menu
     if (!isset($input['menu_show'])) {
         $input['menu_show'] = 0;
         $input['menu_module'] = '';
         $input['menu_module_icon'] = '';
         $input['menu_item'] = '';
         $input['menu_item_route'] = '';
     }
     $permission = Permission::create($input);
     //Assign permissions to roles
     if (isset($input['roles_assg'])) {
         $permission->roles()->sync($input['roles_assg']);
     }
     Session::flash('flash_message', trans('admin/permissions.form.create_confirm'));
     return redirect()->back();
 }