public function getAllPermissions()
    {

        $permissions = [];

        $roles = $this->group->roles()->with('permissions')->get();

        // Go through every role...
        foreach ($roles as $role) {

            // ... in every defined permission
            foreach ($role->permissions as $permission) {

                // only add permissions if it is not an inverse
                if (! $permission->pivot->not)
                    array_push($permissions, $permission->title);
            }

        }

        return $permissions;
    }
public function getAllPermissions()
    {

        $permissions = [];

        $roles = $this->group->roles()->with('permissions')->get();

        // Go through every role...
        foreach ($roles as $role) {

            // ... in every defined permission
            foreach ($role->permissions as $permission) {

                // only add permissions if it is not an inverse
                if (! $permission->pivot->not)
                    array_push($permissions, $permission->title);
            }

        }

        return $permissions;
    }
public function getAllPermissions ( ) { $ permissions = [ ] ; $ roles = $ this -> group -> roles ( ) -> with ( 'permissions' ) -> get ( ) ; // Go through every role... foreach ( $ roles as $ role ) { // ... in every defined permission foreach ( $ role -> permissions as $ permission ) { // only add permissions if it is not an inverse if ( ! $ permission -> pivot -> not ) array_push ( $ permissions , $ permission -> title ) ; } } return $ permissions ; }
Return an array of all the of the permissions
that the user has.

@return array
Return an array of all the of the permissions that the user has .