public function store(CreateRoleRequest $request)
    {
        $input = $request->all();

        $role = $this->roleRepository->create([
            'name' => $input['name'],
        ]);

        foreach ($input['permissions'] as $permission) {
            $role->permissions()->attach($permission);
        }

        \Flash::success(trans('l5starter::messages.create.success'));

        return redirect(route('admin.roles.index'));
    }
public function store(CreateRoleRequest $request)
    {
        $input = $request->all();

        $role = $this->roleRepository->create([
            'name' => $input['name'],
        ]);

        foreach ($input['permissions'] as $permission) {
            $role->permissions()->attach($permission);
        }

        \Flash::success(trans('l5starter::messages.create.success'));

        return redirect(route('admin.roles.index'));
    }
public function store ( CreateRoleRequest $ request ) { $ input = $ request -> all ( ) ; $ role = $ this -> roleRepository -> create ( [ 'name' => $ input [ 'name' ] , ] ) ; foreach ( $ input [ 'permissions' ] as $ permission ) { $ role -> permissions ( ) -> attach ( $ permission ) ; } \ Flash :: success ( trans ( 'l5starter::messages.create.success' ) ) ; return redirect ( route ( 'admin.roles.index' ) ) ; }
Store a newly created Role in storage.

@param CreateRoleRequest $request

@return Response
Store a newly created Role in storage .