Skip to content
php
class Esampe extends Model
{
    use HasFactory;

    protected $fillable = ['title','order','desc','preview','cat_id'];
 		protected $with = ['cat'];
  
    public function cat(){
        return $this->belongsTo(Cat::class);
    }

    public function products(){
        return $this->hasMany(Product::class);
    }
}

Lucking