mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-21 17:51:12 -05:00
Add models, enums, and services for user roles, theme preferences, slug history, and ID generation
This commit is contained in:
25
app/Enums/ThemePreference.php
Normal file
25
app/Enums/ThemePreference.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ThemePreference: string
|
||||
{
|
||||
case LIGHT = 'light';
|
||||
case DARK = 'dark';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::LIGHT => 'Light',
|
||||
self::DARK => 'Dark',
|
||||
};
|
||||
}
|
||||
|
||||
public function cssClass(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::LIGHT => 'theme-light',
|
||||
self::DARK => 'theme-dark',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user