feat: initial laravel install, models, seeders
This commit is contained in:
39
site/app/Models/Overlay.php
Normal file
39
site/app/Models/Overlay.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Overlay extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'overlays';
|
||||
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
|
||||
public function artist()
|
||||
{
|
||||
return $this->belongsTo(Artist::class);
|
||||
}
|
||||
|
||||
public function artworks()
|
||||
{
|
||||
return $this->belongsToMany(Artwork::class);
|
||||
}
|
||||
|
||||
public function postcast()
|
||||
{
|
||||
return $this->belongsTo(Podcast::class);
|
||||
}
|
||||
|
||||
public function episodes()
|
||||
{
|
||||
return $this->hasManyThrough(Episode::class, Artwork::class);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user