feat: add domain management system
This commit is contained in:
25
app/enum/DomainType.php
Normal file
25
app/enum/DomainType.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\enum;
|
||||
|
||||
enum DomainType: string
|
||||
{
|
||||
case PUBLIC = 'public';
|
||||
case PREMIUM = 'premium';
|
||||
|
||||
public function getColor(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::PUBLIC => 'warning',
|
||||
self::PREMIUM => 'success',
|
||||
};
|
||||
}
|
||||
|
||||
public function getLabel(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::PUBLIC => 'Public',
|
||||
self::PREMIUM => 'Premium',
|
||||
};
|
||||
}
|
||||
}
|
||||
31
app/enum/ProviderType.php
Normal file
31
app/enum/ProviderType.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\enum;
|
||||
|
||||
enum ProviderType: string
|
||||
{
|
||||
case GMAIL = 'gmail.com';
|
||||
case YAHOO = 'yahoo.com';
|
||||
case OUTLOOK = 'outlook.com';
|
||||
case CUSTOM = 'custom';
|
||||
|
||||
public function getColor(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::GMAIL => 'danger',
|
||||
self::YAHOO => 'primary',
|
||||
self::OUTLOOK => 'info',
|
||||
self::CUSTOM => 'success',
|
||||
};
|
||||
}
|
||||
|
||||
public function getLabel(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::GMAIL => 'Gmail',
|
||||
self::YAHOO => 'Yahoo',
|
||||
self::OUTLOOK => 'Outlook',
|
||||
self::CUSTOM => 'Custom',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user