Initial
This commit is contained in:
36
app/Models/Image.php
Normal file
36
app/Models/Image.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Image extends Model
|
||||
{
|
||||
|
||||
protected $fillable = [
|
||||
'comic_id',
|
||||
'chapter_id',
|
||||
'order',
|
||||
'url',
|
||||
'metadata',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'metadata' => 'json',
|
||||
];
|
||||
}
|
||||
|
||||
public function chapter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Chapter::class);
|
||||
}
|
||||
|
||||
public function comic(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Comic::class);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user