* * @version 1.0.0 */ class Sale extends Model { protected $fillable = [ 'user_id', 'cash_register_id', 'invoice_number', 'subtotal', 'tax', 'total', 'cash_received', 'change', 'payment_method', 'status', ]; protected $casts = [ 'subtotal' => 'decimal:2', 'tax' => 'decimal:2', 'total' => 'decimal:2', 'cash_received' => 'decimal:2', 'change' => 'decimal:2', ]; public function user() { return $this->belongsTo(User::class); } public function details() { return $this->hasMany(SaleDetail::class); } public function cashRegister() { return $this->belongsTo(CashRegister::class); } }