src/Defender/Traits/HasDefender.php
protected function getFreshAllPermissions()
    {
        $permissionsRoles = $this->getRolesPermissions(true);

        $permissions = app('defender.permission')->getActivesByUser($this);

        $permissions = $permissions->merge($permissionsRoles)
            ->map(function ($permission) {
                unset($permission->pivot, $permission->created_at, $permission->updated_at);

                return $permission;
            });

        return $permissions->toBase();
    }
protected function getFreshAllPermissions()
    {
        $permissionsRoles = $this->getRolesPermissions(true);

        $permissions = app('defender.permission')->getActivesByUser($this);

        $permissions = $permissions->merge($permissionsRoles)
            ->map(function ($permission) {
                unset($permission->pivot, $permission->created_at, $permission->updated_at);

                return $permission;
            });

        return $permissions->toBase();
    }
protected function getFreshAllPermissions ( ) { $ permissionsRoles = $ this -> getRolesPermissions ( true ) ; $ permissions = app ( 'defender.permission' ) -> getActivesByUser ( $ this ) ; $ permissions = $ permissions -> merge ( $ permissionsRoles ) -> map ( function ( $ permission ) { unset ( $ permission -> pivot , $ permission -> created_at , $ permission -> updated_at ) ; return $ permission ; } ) ; return $ permissions -> toBase ( ) ; }
Get fresh permissions from database.

@return \Illuminate\Support\Collection
Get fresh permissions from database .