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:
pacnpal
2025-02-25 20:37:19 -05:00
parent 8951e59f49
commit 64b0e90a27
35 changed files with 3157 additions and 1 deletions

43
app/Models/Designer.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Str;
class Designer extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array<string>
*/
protected $fillable = [
'name',
'slug',
'bio',
];
/**
* Boot the model.
*/
protected static function boot()
{
parent::boot();
static::creating(function ($designer) {
if (empty($designer->slug)) {
$designer->slug = Str::slug($designer->name);
}
});
}
/**
* Get the rides designed by this designer.
*/
public function rides(): HasMany
{
return $this->hasMany(Ride::class);
}
}