mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-22 09:31:09 -05:00
Add enums for ReviewStatus, TrackMaterial, LaunchType, RideCategory, and RollerCoasterType; implement Designer and RideModel models; create migrations for ride_models and helpful_votes tables; enhance RideGalleryComponent documentation
This commit is contained in:
42
app/Enums/RideCategory.php
Normal file
42
app/Enums/RideCategory.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum RideCategory: string
|
||||
{
|
||||
case SELECT = '';
|
||||
case ROLLER_COASTER = 'RC';
|
||||
case DARK_RIDE = 'DR';
|
||||
case FLAT_RIDE = 'FR';
|
||||
case WATER_RIDE = 'WR';
|
||||
case TRANSPORT = 'TR';
|
||||
case OTHER = 'OT';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::SELECT => 'Select ride type',
|
||||
self::ROLLER_COASTER => 'Roller Coaster',
|
||||
self::DARK_RIDE => 'Dark Ride',
|
||||
self::FLAT_RIDE => 'Flat Ride',
|
||||
self::WATER_RIDE => 'Water Ride',
|
||||
self::TRANSPORT => 'Transport',
|
||||
self::OTHER => 'Other',
|
||||
};
|
||||
}
|
||||
|
||||
public static function values(): array
|
||||
{
|
||||
return array_column(self::cases(), 'value');
|
||||
}
|
||||
|
||||
public static function labels(): array
|
||||
{
|
||||
return array_map(fn($case) => $case->label(), self::cases());
|
||||
}
|
||||
|
||||
public static function options(): array
|
||||
{
|
||||
return array_combine(self::values(), self::labels());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user