37 lines
715 B
PHP
37 lines
715 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ArtworkContributor extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'artwork_id',
|
|
'user_id',
|
|
'credit_role',
|
|
'is_primary',
|
|
'sort_order',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_primary' => 'boolean',
|
|
'sort_order' => 'integer',
|
|
];
|
|
|
|
public function artwork(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Artwork::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
} |