public function getPermissionsAttribute()
    {
        $permissions = new Collection();

        foreach ($this->roles as $role) {
            foreach ($role->permissions as $permission) {
                $permissions->push($permission);
            }
        }

        return $permissions;
    }
public function getPermissionsAttribute()
    {
        $permissions = new Collection();

        foreach ($this->roles as $role) {
            foreach ($role->permissions as $permission) {
                $permissions->push($permission);
            }
        }

        return $permissions;
    }
public function getPermissionsAttribute ( ) { $ permissions = new Collection ( ) ; foreach ( $ this -> roles as $ role ) { foreach ( $ role -> permissions as $ permission ) { $ permissions -> push ( $ permission ) ; } } return $ permissions ; }
Get 'permissions' attribute.

@return Collection
Get permissions attribute .