Mantenedor de compras!

This commit is contained in:
2021-07-14 03:58:17 -04:00
parent 4b71bc67aa
commit 0816f37611
9 changed files with 436 additions and 29 deletions

View File

@@ -11,6 +11,13 @@ class Factura extends Model {
use UuidPrimaryKey, SoftDeletes;
protected $table = 'facturas';
protected $fillable = ['id', 'numero', 'monto_bruto', 'compra_id'];
public static function findOrFail($id) {
$factura = Factura::find($id);
if(!$factura) throw new ModelNotFoundException("factura", $id);
return $factura;
}
public function compra() {
return $this->belongsTo(Compra::class);