Files
unified-restaurant-original/backend/app/Models/Producto.php

30 lines
645 B
PHP

<?php
namespace App\Models;
use App\Traits\UuidPrimaryKey;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Producto extends Model {
use UuidPrimaryKey, SoftDeletes;
protected $table = 'productos';
public function recetas() {
return $this->hasMany(Receta::class, 'producto_id');
}
public function categoria() {
return $this->belongsTo(Categoria::class);
}
public function zonaProduccion() {
return $this->belongsTo(ZonaProduccion::class);
}
public function restaurante() {
return $this->belongsTo(Restaurante::class);
}
}