public function storeResource()
    {
        $this->validate($this->request, [
            'resource' => 'required|alpha_num',
        ]);

        $permissions = Permission::createResource($this->request->resource);
        foreach ($permissions as $permission) {
            $permission->syncRoles($this->request->get('roles', []));
        }

        return redirect()->route('administrator.permissions.index');
    }
public function storeResource()
    {
        $this->validate($this->request, [
            'resource' => 'required|alpha_num',
        ]);

        $permissions = Permission::createResource($this->request->resource);
        foreach ($permissions as $permission) {
            $permission->syncRoles($this->request->get('roles', []));
        }

        return redirect()->route('administrator.permissions.index');
    }
public function storeResource ( ) { $ this -> validate ( $ this -> request , [ 'resource' => 'required|alpha_num' , ] ) ; $ permissions = Permission :: createResource ( $ this -> request -> resource ) ; foreach ( $ permissions as $ permission ) { $ permission -> syncRoles ( $ this -> request -> get ( 'roles' , [ ] ) ) ; } return redirect ( ) -> route ( 'administrator.permissions.index' ) ; }
Store permission resource.

@return \Illuminate\Http\RedirectResponse
Store permission resource .