reconstruction of the project
This commit is contained in:
@@ -7,7 +7,10 @@ use App\Models\BaseModel;
|
||||
class PaypalTransaction extends BaseModel
|
||||
{
|
||||
protected $table = 'paypal_transactions';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
// ✅ CI: useTimestamps = true (created_at/updated_at)
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = [
|
||||
'transaction_id',
|
||||
'payment_id',
|
||||
@@ -26,5 +29,18 @@ class PaypalTransaction extends BaseModel
|
||||
'school_year',
|
||||
'semester',
|
||||
];
|
||||
public $timestamps = true;
|
||||
|
||||
protected $casts = [
|
||||
'payment_id' => 'integer',
|
||||
'amount' => 'decimal:2', // adjust precision if needed
|
||||
'transaction_fee' => 'decimal:2', // adjust precision if needed
|
||||
// raw_data is often JSON; if it's JSON in DB, cast to array
|
||||
'raw_data' => 'array',
|
||||
];
|
||||
|
||||
/* Optional relationship */
|
||||
public function payment()
|
||||
{
|
||||
return $this->belongsTo(Payment::class, 'payment_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user