43 lines
974 B
PHP
43 lines
974 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
|
|
class Outfit extends Model
|
|
{
|
|
use HasUuids;
|
|
|
|
protected $table = 'outfits';
|
|
protected $primaryKey = 'object_id';
|
|
|
|
public string $object_id;
|
|
public string $submitter_id;
|
|
public string $tag;
|
|
public string $link;
|
|
public string $file_path;
|
|
public string $meta;
|
|
public bool $is_deleted;
|
|
public bool $is_featured;
|
|
public int $view_count;
|
|
public int $likes;
|
|
public string $delete_hash;
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DiscordUser::class, 'id', 'submitter_id');
|
|
}
|
|
|
|
public function casts(): array
|
|
{
|
|
return [
|
|
'date' => 'date',
|
|
'is_deleted' => 'boolean',
|
|
'is_featured' => 'boolean',
|
|
];
|
|
}
|
|
}
|