feat: Implement payment proof upload for orders, add payment method selection API, and seed bank transfer payment options.
This commit is contained in:
@@ -46,7 +46,7 @@ class Order extends Model
|
||||
|
||||
public function payment()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Payment::class);
|
||||
return $this->belongsTo(\App\Models\Payment::class, 'payment_method', 'id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
@@ -56,7 +56,7 @@ class Order extends Model
|
||||
|
||||
public function orderItem()
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\InvoiceItem::class, 'order__order_item', 'order_id', 'invoice_item_id');
|
||||
return $this->belongsToMany(\App\Models\InvoiceItem::class, 'order_items', 'order_id', 'invoice_item_id');
|
||||
}
|
||||
|
||||
public function orderItems()
|
||||
|
||||
@@ -9,9 +9,10 @@ class OrderItem extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'order__order_item';
|
||||
protected $table = 'order_items';
|
||||
protected $guarded = [];
|
||||
public $timestamps = false;
|
||||
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo(Order::class, 'order_id');
|
||||
|
||||
@@ -24,6 +24,10 @@ class Payment extends Model
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Invoice::class);
|
||||
}
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Order::class);
|
||||
}
|
||||
public function getStatus()
|
||||
{
|
||||
return match ($this->attributes['status']) {
|
||||
|
||||
@@ -75,6 +75,15 @@ class Product extends Model
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Relationship: Product has many OS via product_os table (VPS OS selection)
|
||||
*/
|
||||
public function operatingSystems()
|
||||
{
|
||||
return $this->belongsToMany(Os::class, 'product_os', 'product_id', 'os_id')
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Relationship: Product has many Control Panels (for Hosting)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user