Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(RoleRequest $request)
 {
     $role = new Role();
     $role->fill($request->all());
     $role->name = snake_case($request->display_name);
     $role->save();
     $role->attachPermissions($request->permissions);
     return redirect()->route('rol.index');
 }
Ejemplo n.º 2
0
 public function store(RoleRequest $request)
 {
     if (!Helper::getMode()) {
         return redirect()->back()->withErrors(config('constants.DISABLE_MESSAGE'));
     }
     $role = new Role();
     $data = $request->all();
     $role->fill($data);
     $role->save();
     return redirect('/configuration#permission')->withSuccess(config('constants.ADDED'));
 }
Ejemplo n.º 3
0
 /**
  * Add a new role
  *
  * @return View
  */
 public function do_addRole()
 {
     /** Role $role */
     $role = new Role();
     // Populate data from old request
     $role->fill(Request::old());
     // Share View Variables
     View::share('role', $role);
     View::share('_pageName', 'Add Role');
     View::share('_title', 'Add Role');
     View::share('_pageAction', '/Admin/createRole');
     // Render the template
     return $this->_renderTemplate('Admin.Role');
 }
Ejemplo n.º 4
0
 /**
  * save.
  *
  * @param Role $role role
  * @param Request $input   输入
  */
 public function savePost($role, $input)
 {
     $role->fill($input);
     return $role->save();
 }