Download src/app/Models/PaymentLog.php from pnacorp/xsender: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/pnacorp/xsender/resolve/main/src/app/Models/PaymentLog.php
- Command line
-
hf download hf://pnacorp/xsender/src/app/Models/PaymentLog.php
-
curl -L -o PaymentLog.php https://huggingface.co/pnacorp/xsender/resolve/main/src/app/Models/PaymentLog.php
1.33 kB
| namespace App\Models; | |
| use Illuminate\Database\Eloquent\Factories\HasFactory; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Notifications\Notifiable; | |
| use Illuminate\Database\Eloquent\Builder; | |
| use App\Traits\Filterable; | |
| class PaymentLog extends Model | |
| { | |
| use HasFactory, Notifiable, Filterable; | |
| const PENDING = 1; | |
| const SUCCESS = 2; | |
| const CANCEL = 3; | |
| protected $fillable = [ | |
| 'subscriptions_id', | |
| 'user_id', | |
| 'method_id', | |
| 'amount', | |
| 'charge', | |
| 'rate', | |
| 'final_amount', | |
| 'trx_number', | |
| 'user_data', | |
| 'status', | |
| ]; | |
| protected $casts = [ | |
| 'user_data' => 'object' | |
| ]; | |
| public function paymentGateway() | |
| { | |
| return $this->belongsTo(PaymentMethod::class,'method_id'); | |
| } | |
| public function plan() | |
| { | |
| return $this->belongsTo(Subscription::class, 'subscriptions_id'); | |
| } | |
| public function user() | |
| { | |
| return $this->belongsTo(User::class, 'user_id'); | |
| } | |
| public function scopeApproved($query) | |
| { | |
| return $query->where('status', self::SUCCESS); | |
| } | |
| public function scopePending($query) | |
| { | |
| return $query->where('status', self::PENDING); | |
| } | |
| public function scopeCancel($query) | |
| { | |
| return $query->where('status', self::CANCEL); | |
| } | |
| } | |