-
-
Notifications
You must be signed in to change notification settings - Fork 687
Expand file tree
/
Copy pathOrder.php
More file actions
70 lines (58 loc) · 1.72 KB
/
Copy pathOrder.php
File metadata and controls
70 lines (58 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
namespace HiEvents\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
class Order extends BaseModel
{
use SoftDeletes;
public function question_and_answer_views(): HasMany
{
return $this->hasMany(QuestionAndAnswerView::class);
}
public function stripe_payment(): HasOne
{
return $this->hasOne(StripePayment::class);
}
public function order_items(): HasMany
{
return $this->hasMany(OrderItem::class);
}
public function attendees(): HasMany
{
return $this->hasMany(Attendee::class);
}
public function event(): BelongsTo
{
return $this->belongsTo(Event::class);
}
public function invoices(): HasMany
{
return $this->hasMany(Invoice::class)->orderBy('created_at', 'desc');
}
public function order_application_fee(): HasOne
{
return $this->hasOne(OrderApplicationFee::class);
}
public function affiliate(): BelongsTo
{
return $this->belongsTo(Affiliate::class);
}
protected function getCastMap(): array
{
return [
'total_before_additions' => 'float',
'total_tax' => 'float',
'total_gross' => 'float',
'total_discount' => 'float',
'total_fee' => 'float',
'total_refunded' => 'float',
'point_in_time_data' => 'array',
'address' => 'array',
'taxes_and_fees_rollup' => 'array',
'statistics_decremented_at' => 'datetime',
'opted_into_marketing_at' => 'datetime',
];
}
}