Update source into github

This commit is contained in:
pbao9
2025-07-24 16:18:27 +07:00
parent 41419358dd
commit 69851ac7bc
2642 changed files with 284095 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class OrderItem extends Model
{
use HasFactory;
protected $table = 'order__order_item';
protected $guarded = [];
public $timestamps = false;
public function order()
{
return $this->belongsTo(Order::class, 'order_id');
}
public function addons()
{
return $this->hasMany(OrderAddon::class, 'order_item_id');
}
public function getProductAttribute()
{
return match ($this->product_type) {
3 => Hosting::find($this->product_id),
4 => Vps::find($this->product_id),
default => null,
};
}
public function os()
{
return $this->belongsTo(Os::class, 'os_id');
}
}