src/Controllers/RoleController.php
public function store(RoleRequest $request)
    {
        $this->authorize('create_role');

        $role = Roles::create($request->all());
        if (!empty($request->permission) AND is_array($request->permission)) {
            foreach ($request->permission as $permission) {
                $role->permissions()->attach($permission);
            }
        }
        $request->session()->flash('message', 'Role Successfully Created');
        return redirect()->route('RoleManager::role.edit', $role->id);
    }
public function store(RoleRequest $request)
    {
        $this->authorize('create_role');

        $role = Roles::create($request->all());
        if (!empty($request->permission) AND is_array($request->permission)) {
            foreach ($request->permission as $permission) {
                $role->permissions()->attach($permission);
            }
        }
        $request->session()->flash('message', 'Role Successfully Created');
        return redirect()->route('RoleManager::role.edit', $role->id);
    }
Store a newly created resource in storage.

@param Request|RoleRequest $request

@return \Illuminate\Http\Response