add OAUth2.0
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?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',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user