dishplanner/app/Enums/AppModeEnum.php

40 lines
680 B
PHP
Raw Normal View History

2026-01-05 21:43:00 +01:00
<?php
namespace App\Enums;
enum AppModeEnum: string
{
case APP = 'app';
case SAAS = 'saas';
2026-01-08 00:37:33 +01:00
case DEMO = 'demo';
2026-01-05 21:43:00 +01:00
public static function current(): self
{
return self::from(config('app.mode', 'app'));
}
public function isApp(): bool
{
return $this === self::APP;
}
public function isSaas(): bool
{
return $this === self::SAAS;
}
2026-01-08 00:37:33 +01:00
public function isDemo(): bool
{
return $this === self::DEMO;
}
public function requiresSubscription(): bool
{
return $this === self::SAAS;
}
public function allowsLogout(): bool
{
return $this !== self::DEMO;
}
2026-01-05 21:43:00 +01:00
}