public function update(Role $role)
    {
        $this->validate($this->request, [
            'name'        => 'required',
            'slug'        => 'required|unique:roles,slug,' . $role->id,
        ]);

        $role->name = $this->request->get('name');
        if (! $role->system) {
            $role->slug = $this->request->get('slug');
        }
        $role->save();

        $role->syncPermissions($this->request->get('permissions', []));
        flash()->success('Role ' . $role->name . ' successfully updated!');

        return redirect()->route('administrator.roles.index');
    }
public function update(Role $role)
    {
        $this->validate($this->request, [
            'name'        => 'required',
            'slug'        => 'required|unique:roles,slug,' . $role->id,
        ]);

        $role->name = $this->request->get('name');
        if (! $role->system) {
            $role->slug = $this->request->get('slug');
        }
        $role->save();

        $role->syncPermissions($this->request->get('permissions', []));
        flash()->success('Role ' . $role->name . ' successfully updated!');

        return redirect()->route('administrator.roles.index');
    }
public function update ( Role $ role ) { $ this -> validate ( $ this -> request , [ 'name' => 'required' , 'slug' => 'required|unique:roles,slug,' . $ role -> id , ] ) ; $ role -> name = $ this -> request -> get ( 'name' ) ; if ( ! $ role -> system ) { $ role -> slug = $ this -> request -> get ( 'slug' ) ; } $ role -> save ( ) ; $ role -> syncPermissions ( $ this -> request -> get ( 'permissions' , [ ] ) ) ; flash ( ) -> success ( 'Role ' . $ role -> name . ' successfully updated!' ) ; return redirect ( ) -> route ( 'administrator.roles.index' ) ; }
Update role permission.

@param \Yajra\Acl\Models\Role $role
@return \Illuminate\Http\RedirectResponse
Update role permission .