Total Complexity | 6 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
27 | class Transfer extends Model |
||
28 | { |
||
29 | |||
30 | public const STATUS_TRANSFER = 'transfer'; |
||
31 | public const STATUS_PAID = 'paid'; |
||
32 | public const STATUS_REFUND = 'refund'; |
||
33 | public const STATUS_GIFT = 'gift'; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $fillable = [ |
||
39 | 'status', |
||
40 | 'deposit_id', |
||
41 | 'withdraw_id', |
||
42 | 'from_type', |
||
43 | 'from_id', |
||
44 | 'to_type', |
||
45 | 'to_id', |
||
46 | 'uuid', |
||
47 | 'fee', |
||
48 | ]; |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getTable(): string |
||
54 | { |
||
55 | if (!$this->table) { |
||
56 | $this->table = config('wallet.transfer.table'); |
||
57 | } |
||
58 | |||
59 | return parent::getTable(); |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return MorphTo |
||
64 | */ |
||
65 | public function from(): MorphTo |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return MorphTo |
||
72 | */ |
||
73 | public function to(): MorphTo |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @return BelongsTo |
||
80 | */ |
||
81 | public function deposit(): BelongsTo |
||
82 | { |
||
83 | return $this->belongsTo(Transaction::class, 'deposit_id'); |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @return BelongsTo |
||
88 | */ |
||
89 | public function withdraw(): BelongsTo |
||
92 | } |
||
93 | |||
94 | } |
||
95 |