pre version 2
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum GoogleService: string
|
||||
{
|
||||
case Email = 'email';
|
||||
case Drive = 'drive';
|
||||
case Calendar = 'calendar';
|
||||
|
||||
public function scopes(): array
|
||||
{
|
||||
return match ($this) {
|
||||
self::Email => ['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::Email => 'Gmail',
|
||||
self::Drive => 'Google Drive',
|
||||
self::Calendar => 'Google Calendar',
|
||||
};
|
||||
}
|
||||
|
||||
public function icon(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Email => 'fas fa-envelope',
|
||||
self::Drive => 'fab fa-google-drive',
|
||||
self::Calendar => 'fas fa-calendar-alt',
|
||||
};
|
||||
}
|
||||
|
||||
public function description(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Email => 'Invia e ricevi email tramite Gmail API (alternativa a SMTP/IMAP con password)',
|
||||
self::Drive => 'Accedi ai file su Google Drive per documenti e allegati',
|
||||
self::Calendar => 'Sincronizza eventi con Google Calendar',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user