ifnex/04_Laravel/app/Models/Payment.php
Kazem Alghasi 50ae20b14a feat(api): implement payment gateway integration
Add Zarinpal configuration options and implement the core payment
infrastructure, including the Payment model, migration, service
layer, and API controller.
2026-08-05 23:49:33 +03:30

38 lines
705 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Payment extends Model
{
protected $fillable = [
'user_id',
'wallet_id',
'gateway',
'merchant_id',
'authority',
'ref_id',
'amount',
'currency',
'status',
'description',
'paid_at',
];
protected $casts = [
'amount' => 'integer',
'paid_at' => 'datetime',
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function wallet(): BelongsTo
{
return $this->belongsTo(Wallet::class);
}
}