braintree_api/app/Models/BraintreePayment.php
2025-05-30 14:14:53 +02:00

33 lines
847 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class BraintreePayment extends Model
{
protected $table = 'rcd_braintree_payments';
protected $primaryKey = 'transaction_id';
public $incrementing = false;
protected $keyType = 'string';
public $timestamps = true;
protected $guarded = [];
public function braintreePaymentStatus(): HasMany
{
return $this->hasMany(BraintreePaymentStatus::class, 'transaction_id');
}
public function braintreePaymentRefund(): HasMany
{
return $this->hasMany(BraintreePaymentRefund::class, 'transaction_id');
}
public function order(): belongsTo
{
return $this->belongsTo(Order::class, 'order_id');
}
}