braintree_api/app/Models/BraintreePayment.php
2025-06-18 10:58:31 +02:00

33 lines
848 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, 'orders_id');
}
}