36 lines
767 B
PHP
36 lines
767 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\UuidPrimaryKey;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class CanalVenta extends Model {
|
|
use UuidPrimaryKey, SoftDeletes;
|
|
|
|
protected $table = 'canales_venta';
|
|
|
|
public static function findOrFail($id) {
|
|
$canal_venta = CanalVenta::find($id);
|
|
|
|
if(!$canal_venta){
|
|
throw new ModelNotFoundException("canal_venta", $id);
|
|
}
|
|
|
|
return $canal_venta;
|
|
}
|
|
|
|
public function tipoCanal() {
|
|
return $this->belongsTo(TipoCanal::class);
|
|
}
|
|
|
|
public function sector() {
|
|
return $this->belongsTo(Sector::class);
|
|
}
|
|
|
|
public function restaurante() {
|
|
return $this->belongsTo(Restaurante::class);
|
|
}
|
|
}
|