Initial commit
This commit is contained in:
32
app/Models/Band.php
Normal file
32
app/Models/Band.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user