dishplanner/app/Enums/AppModeEnum.php

40 lines
No EOL
680 B
PHP

<?php
namespace App\Enums;
enum AppModeEnum: string
{
case APP = 'app';
case SAAS = 'saas';
case DEMO = 'demo';
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;
}
public function isDemo(): bool
{
return $this === self::DEMO;
}
public function requiresSubscription(): bool
{
return $this === self::SAAS;
}
public function allowsLogout(): bool
{
return $this !== self::DEMO;
}
}