File: /var/www/matriculas_api_dev/app/Models/PresencialPayment.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class PresencialPayment extends Model
{
protected $table = 'presencial_payments';
protected $fillable = [
'contract_id',
'payment_method_id',
'amount',
'reference_number',
'attachment_path',
'receipt_data',
'notes',
'registered_by',
'reconciliation_status',
'subscription_status',
'subscription_link',
'reminder_sent_at',
];
protected $casts = [
'receipt_data' => 'array',
'amount' => 'decimal:2',
];
public function contract()
{
return $this->belongsTo(Contract::class, 'contract_id');
}
public function registeredByUser()
{
return $this->belongsTo(User::class, 'registered_by');
}
public function paymentMethodRecord()
{
return $this->belongsTo(PaymentMethods::class, 'payment_method_id');
}
}