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

        $permission = $this->permissionRepository->create([
            'name' => $input['name'],
        ]);

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

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

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

        $permission = $this->permissionRepository->create([
            'name' => $input['name'],
        ]);

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

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

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

@param CreatePermissionRequest $request

@return Response
Store a newly created Permission in storage .