mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 11:51:11 -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:
34
app/Enums/TrackMaterial.php
Normal file
34
app/Enums/TrackMaterial.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum TrackMaterial: string
|
||||
{
|
||||
case STEEL = 'STEEL';
|
||||
case WOOD = 'WOOD';
|
||||
case HYBRID = 'HYBRID';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::STEEL => 'Steel',
|
||||
self::WOOD => 'Wood',
|
||||
self::HYBRID => 'Hybrid',
|
||||
};
|
||||
}
|
||||
|
||||
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