30 lines
563 B
PHP
30 lines
563 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class RecipeImage extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'recipe_id',
|
||
|
|
'image_path',
|
||
|
|
'title',
|
||
|
|
'description',
|
||
|
|
'is_featured',
|
||
|
|
'sort_order',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'recipe_id' => 'integer',
|
||
|
|
'is_featured' => 'boolean',
|
||
|
|
'sort_order' => 'integer',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function recipe(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Recipe::class);
|
||
|
|
}
|
||
|
|
}
|