feat: meal post ingredients
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\IngredientUnit;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class MealPostIngredients extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'meal_posts_id',
|
||||
'position',
|
||||
'ingredient',
|
||||
'unit',
|
||||
];
|
||||
|
||||
public function mealPosts(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(MealPosts::class);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'unit' => IngredientUnit::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user