Skip to main content

Feature Flags

Allegro has two kinds of feature flags:

  • Tenant flags belong to a single tenant and are evaluated per organization.
  • Platform-wide (landlord) flags are global. They live on the landlord rather than on any tenant, and read the same value everywhere — across every tenant, the landlord dashboard, queued jobs, and console commands.

This page covers the platform-wide flags. They are managed by a super admin and are kept completely separate from a tenant's own flags.

Managing platform-wide flags

From the landlord dashboard, open Settings → Feature Flags. The page lists every platform-wide flag with its description and a toggle. Switching a flag on or off applies immediately across the whole installation — there's no deploy or cache-clear step.

Only super admins can view or change platform-wide flags.

note

Platform-wide flags are stored on the landlord connection, in a features table separate from each tenant's flags. Turning a platform flag on or off has no effect on any tenant-level flag of the same name, and vice versa.

Defining a platform-wide flag

Platform-wide flags are defined in code and then toggled from the settings page. To add one, create a class in the Allegro\Features\Landlord namespace (under src/Features/Landlord/) that exposes a resolve() method returning the flag's default value. Allegro discovers the class automatically and it appears on the Feature Flags page.

namespace Allegro\Features\Landlord;

use Allegro\Features\Attributes\FeatureDescription;
use Allegro\Features\LandlordFeature;

#[FeatureDescription(
'Show a platform-wide maintenance banner across every tenant and landlord dashboard.',
label: 'Maintenance banner',
)]
class MaintenanceBanner
{
public function resolve(mixed $scope = null): bool
{
return false;
}

public static function isActive(): bool
{
return LandlordFeature::active(self::class);
}
}

The #[FeatureDescription] attribute supplies the label and description shown on the settings page. The resolve() method returns the value a flag starts with before anyone toggles it — return false for a flag that ships off by default.

Read the flag anywhere in the application with LandlordFeature::active(), or expose a small helper on the flag class (such as the isActive() method above) for readability:

if (MaintenanceBanner::isActive()) {
// …
}

Because the value is resolved against a single global scope, it reads the same whether you check it inside a tenant request, the landlord dashboard, a queued job, or a scheduled command.