public function sync($listener, $vendor, $package = null)
    {
        $roles = [];
        $name = $this->getExtension($vendor, $package)->get('name');
        $acl = $this->acl->get($name);

        if (is_null($acl)) {
            return $listener->aclVerificationFailed();
        }

        foreach ($this->model->all() as $role) {
            $roles[] = $role->name;
        }

        $acl->roles()->attach($roles);

        $acl->sync();

        return $listener->syncSucceed(new Fluent(compact('vendor', 'package', 'name')));
    }
public function sync($listener, $vendor, $package = null)
    {
        $roles = [];
        $name = $this->getExtension($vendor, $package)->get('name');
        $acl = $this->acl->get($name);

        if (is_null($acl)) {
            return $listener->aclVerificationFailed();
        }

        foreach ($this->model->all() as $role) {
            $roles[] = $role->name;
        }

        $acl->roles()->attach($roles);

        $acl->sync();

        return $listener->syncSucceed(new Fluent(compact('vendor', 'package', 'name')));
    }
public function sync ( $ listener , $ vendor , $ package = null ) { $ roles = [ ] ; $ name = $ this -> getExtension ( $ vendor , $ package ) -> get ( 'name' ) ; $ acl = $ this -> acl -> get ( $ name ) ; if ( is_null ( $ acl ) ) { return $ listener -> aclVerificationFailed ( ) ; } foreach ( $ this -> model -> all ( ) as $ role ) { $ roles [ ] = $ role -> name ; } $ acl -> roles ( ) -> attach ( $ roles ) ; $ acl -> sync ( ) ; return $ listener -> syncSucceed ( new Fluent ( compact ( 'vendor' , 'package' , 'name' ) ) ) ; }
Sync role for an ACL instance.

@param  object  $listener
@param  string  $vendor
@param  string|null  $package

@return mixed
Sync role for an ACL instance .