Proveedores

This commit is contained in:
2021-07-12 17:11:04 -04:00
parent c0fdba3072
commit 29f3b11ec5
4 changed files with 163 additions and 0 deletions

View File

@@ -10,6 +10,16 @@ class Proveedor extends Model {
use UuidPrimaryKey, SoftDeletes;
protected $table = 'proveedores';
protected $fillable = [
'id', 'rut', 'nombre', 'descripcion',
'direccion', 'telefono', 'restaurante_id'
];
public static function findOrFail($id) {
$proveedor = Proveedor::find($id);
if(!$proveedor) throw new ModelNotFoundException("proveedor", $id);
return $proveedor;
}
public function restaurante() {
return $this->belongsTo(Restaurante::class);