Download core/app/Models/RefundRequest.php from pnacorp/codeplus: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/pnacorp/codeplus/resolve/main/core/app/Models/RefundRequest.php
- Command line
-
hf download hf://pnacorp/codeplus/core/app/Models/RefundRequest.php
-
curl -L -o RefundRequest.php https://huggingface.co/pnacorp/codeplus/resolve/main/core/app/Models/RefundRequest.php
1.17 kB
| namespace App\Models; | |
| use App\Traits\GlobalStatus; | |
| use Illuminate\Database\Eloquent\Casts\Attribute; | |
| use Illuminate\Database\Eloquent\Model; | |
| class RefundRequest extends Model | |
| { | |
| use GlobalStatus; | |
| public function orderItem() | |
| { | |
| return $this->belongsTo(OrderItem::class); | |
| } | |
| public function buyer() | |
| { | |
| return $this->belongsTo(User::class, 'buyer_id'); | |
| } | |
| public function user() | |
| { | |
| return $this->belongsTo(User::class, 'user_id'); | |
| } | |
| public function activites() | |
| { | |
| return $this->hasMany(RefundActivity::class); | |
| } | |
| public function statusBadge(): Attribute | |
| { | |
| return new Attribute(function () { | |
| $html = ''; | |
| if ($this->status == 1) { | |
| $html = '<span class="badge badge--success">' . trans('Approved') . '</span>'; | |
| } else if ($this->status == 2) { | |
| $html = '<span class="badge badge--danger">' . trans('Rejected') . '</span>'; | |
| } else { | |
| $html = '<span class="badge badge--warning">' . trans('Pending') . '</span>'; | |
| } | |
| return $html; | |
| }); | |
| } | |
| } | |