Mantenedor de compras!
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user