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

        $role = Role::create($this->request->all());
        $role->syncPermissions($this->request->get('permissions', []));
        flash()->success('Role ' . $role->name . ' successfully created!');

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

        $role = Role::create($this->request->all());
        $role->syncPermissions($this->request->get('permissions', []));
        flash()->success('Role ' . $role->name . ' successfully created!');

        return redirect()->route('administrator.roles.index');
    }
public function store ( ) { $ this -> validate ( $ this -> request , [ 'name' => 'required' , 'slug' => 'required|unique:roles,slug' , ] ) ; $ role = Role :: create ( $ this -> request -> all ( ) ) ; $ role -> syncPermissions ( $ this -> request -> get ( 'permissions' , [ ] ) ) ; flash ( ) -> success ( 'Role ' . $ role -> name . ' successfully created!' ) ; return redirect ( ) -> route ( 'administrator.roles.index' ) ; }
Store a newly created role.

@return \Illuminate\Http\RedirectResponse
Store a newly created role .