mirror of https://github.com/kcal-app/kcal.git
17 lines
322 B
PHP
17 lines
322 B
PHP
<?php
|
|
|
|
namespace App\Models\Traits;
|
|
|
|
use App\Models\IngredientAmount;
|
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
|
|
|
trait HasIngredients
|
|
{
|
|
/**
|
|
* Get all of the ingredients.
|
|
*/
|
|
public function ingredients(): MorphMany {
|
|
return $this->morphMany(IngredientAmount::class, 'parent');
|
|
}
|
|
}
|