Mcuhos cambios .w.
This commit is contained in:
@@ -11,7 +11,7 @@ class ZonaProduccion extends Model {
|
||||
use UuidPrimaryKey, SoftDeletes;
|
||||
|
||||
protected $table = 'zonas_produccion';
|
||||
protected $hidden = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $hidden = ['created_at', 'updated_at', 'deleted_at', 'pivot'];
|
||||
protected $fillable = ['id', 'nombre', 'restaurante_id'];
|
||||
|
||||
public static function findOrFail($id) {
|
||||
@@ -23,4 +23,8 @@ class ZonaProduccion extends Model {
|
||||
public function restaurante() {
|
||||
return $this->belongsTo(Restaurante::class);
|
||||
}
|
||||
|
||||
public function usuarios() {
|
||||
return $this->belongsToMany(Usuario::class, 'productores', 'zona_produccion_id', 'usuario_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user