src/Defender/Traits/Permissions/InteractsWithPermissions.php
public function existPermission($permissionName)
    {
        $permission = $this->permissions->first(function ($key, $value) use ($permissionName) {
            return ((isset($key->name)) ? $key->name : $value->name) == $permissionName;
        });

        if (! empty($permission)) {
            $active = (is_null($permission->pivot->expires) or $permission->pivot->expires->isFuture());

            if ($active) {
                return (bool) $permission->pivot->value;
            }
        }

        return false;
    }
public function existPermission($permissionName)
    {
        $permission = $this->permissions->first(function ($key, $value) use ($permissionName) {
            return ((isset($key->name)) ? $key->name : $value->name) == $permissionName;
        });

        if (! empty($permission)) {
            $active = (is_null($permission->pivot->expires) or $permission->pivot->expires->isFuture());

            if ($active) {
                return (bool) $permission->pivot->value;
            }
        }

        return false;
    }
public function existPermission ( $ permissionName ) { $ permission = $ this -> permissions -> first ( function ( $ key , $ value ) use ( $ permissionName ) { return ( ( isset ( $ key -> name ) ) ? $ key -> name : $ value -> name ) == $ permissionName ; } ) ; if ( ! empty ( $ permission ) ) { $ active = ( is_null ( $ permission -> pivot -> expires ) or $ permission -> pivot -> expires -> isFuture ( ) ) ; if ( $ active ) { return ( bool ) $ permission -> pivot -> value ; } } return false ; }
Get the a permission using the permission name.

@param string $permissionName

@return bool
Get the a permission using the permission name .