X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/platform/plugins/payment/src/Models
home
/
gfecatvj
/
sites
/
realesbar
/
platform
/
plugins
/
payment
/
src
/
Models
/
📁
..
📄
Payment.php
(1.48 KB)
Editing: Payment.php
<?php namespace Botble\Payment\Models; use Botble\ACL\Models\User; use Botble\Base\Models\BaseModel; use Botble\Base\Traits\EnumCastable; use Botble\Payment\Enums\PaymentMethodEnum; use Botble\Payment\Enums\PaymentStatusEnum; use Html; class Payment extends BaseModel { use EnumCastable; /** * The database table used by the model. * * @var string */ protected $table = 'payments'; /** * @var array */ protected $fillable = [ 'amount', 'currency', 'user_id', 'charge_id', 'payment_channel', 'description', 'status', 'order_id', 'payment_type', 'customer_id', 'refunded_amount', 'refund_note', ]; /** * @var array */ protected $casts = [ 'payment_channel' => PaymentMethodEnum::class, 'status' => PaymentStatusEnum::class, ]; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo(User::class)->withDefault(); } /** * @return string */ public function getDescription(): string { $time = Html::tag('span', $this->created_at->diffForHumans(), ['class' => 'small italic']); return 'You have created a payment #' . $this->charge_id . ' via ' . $this->payment_channel->label() . ' ' . $time . ': ' . number_format($this->amount, 2, '.', ',') . $this->currency; } }
Upload File
Create Folder