<?php

namespace App\Models;

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

class Categories extends Model
{
    use HasFactory;

    protected $fillable = ['title', 'description'];
    
    public function meal()
    {
        return $this->hasMany('App\Models\Product', 'cat_id', 'id')->select(['cat_id', 'title as meal_name', 'desc as description', 'recipe as recipe']);
    }
}