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