<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    use HasFactory;

    protected $fillable = ['title', 'desc', 'recipe', 'cat_id'];
    
    // public function category()
    // {
    //     return $this->belongsTo('App\Models\Categories', 'cat_id');
    // }

    public function ingredients()
    {
        return $this->hasMany('App\Models\Ingredients', 'rec_id', 'id')->select(['rec_id', 'ingredient']);
    }
}