Comienzo de api de canales de venta

This commit is contained in:
2021-06-09 18:15:08 -04:00
parent 6583e8faaf
commit b3e4fe20cf
8 changed files with 300 additions and 9 deletions

View File

@@ -11,6 +11,15 @@ class CanalVenta extends Model {
protected $table = 'canales_venta';
public static function findOrNull($id) {
try {
return CanalVenta::find($id);
} catch (QueryException $ex) {
Log::warning('Se intento obtener un canal de venta con un id invalido', ['id' => $id]);
return null;
}
}
public function tipoCanal() {
return $this->belongsTo(TipoCanal::class);
}