Files
glastree/app/Enums/GoogleService.php
T
2026-06-15 11:14:35 +02:00

49 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Enums;
enum GoogleService: string
{
case Gmail = 'gmail';
case Drive = 'drive';
case Calendar = 'calendar';
public function scope(): string
{
return match ($this) {
self::Gmail => 'https://mail.google.com/',
self::Drive => 'https://www.googleapis.com/auth/drive',
self::Calendar => 'https://www.googleapis.com/auth/calendar',
};
}
public function label(): string
{
return match ($this) {
self::Gmail => 'Gmail (lettura e invio email)',
self::Drive => 'Google Drive (file)',
self::Calendar => 'Google Calendar (eventi)',
};
}
public function icon(): string
{
return match ($this) {
self::Gmail => 'fa-google',
self::Drive => 'fa-google-drive',
self::Calendar => 'fa-calendar-alt',
};
}
public function hexColor(): string
{
return match ($this) {
self::Gmail => '#EA4335',
self::Drive => '#34A853',
self::Calendar => '#4285F4',
};
}
}