26 lines
447 B
PHP
26 lines
447 B
PHP
|
<?php
|
||
|
|
||
|
namespace App;
|
||
|
|
||
|
use App\Models\Product;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
||
|
class Recipe extends Model
|
||
|
{
|
||
|
protected $guarded = ['id'];
|
||
|
|
||
|
protected $with = ['steps', 'ingredients'];
|
||
|
|
||
|
protected $hidden = ['created_at', 'updated_at'];
|
||
|
|
||
|
public function steps()
|
||
|
{
|
||
|
return $this->hasMany(RecipeStep::class);
|
||
|
}
|
||
|
|
||
|
public function ingredients()
|
||
|
{
|
||
|
return $this->hasMany(RecipeProduct::class);
|
||
|
}
|
||
|
}
|