forge/app/Models/ModVersion.php
Refringe c1a58e29dd
Multiple Mod Authors
The mod-to-user relationship has been modified to be a many-to-many relationship. Mods can now have multiple authors, and an author can have multiple mods.
2024-07-04 22:10:48 -04:00

30 lines
644 B
PHP

<?php
namespace App\Models;
use App\Models\Scopes\DisabledScope;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class ModVersion extends Model
{
use HasFactory, SoftDeletes;
protected static function booted(): void
{
static::addGlobalScope(new DisabledScope);
}
public function mod(): BelongsTo
{
return $this->belongsTo(Mod::class);
}
public function sptVersion(): BelongsTo
{
return $this->belongsTo(SptVersion::class);
}
}