33 lines
726 B
PHP
33 lines
726 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
|
|
class Band extends Model
|
|
{
|
|
protected $table = 'bands';
|
|
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'order',
|
|
'edi_band_begin',
|
|
'edi_band_end',
|
|
'has_power_category'
|
|
];
|
|
|
|
public function ediBands(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(EdiBand::class, 'bands_edi_bands', 'band_id', 'edi_band_id');
|
|
}
|
|
|
|
public function contests(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(Contest::class, 'contests_bands', 'band_id', 'contest_id');
|
|
}
|
|
}
|