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