| 123456789101112131415161718192021222324252627282930 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class PaymentGateway extends BaseModel
- {
- use SoftDeletes;
- protected $table = 'payment_gateways';
- protected $guarded = [];
- protected $hidden = ['withdrawal_secret', 'deleted_at'];
- protected $casts = [
- 'withdrawal_secret' => 'encrypted',
- 'recharge_channel_group_ids' => 'array',
- 'status' => 'integer',
- ];
- protected $appends = ['has_withdrawal_secret'];
- public function getHasWithdrawalSecretAttribute(): bool
- {
- return !empty($this->attributes['withdrawal_secret'] ?? null);
- }
- public function rechargeChannel()
- {
- return $this->belongsTo(RechargeChannel::class, 'recharge_channel_id');
- }
- }
|