%PDF- %PDF-
Direktori : /home/forge/api-takeaseat.eco-n-tech.co.uk/app/Models/ |
Current File : //home/forge/api-takeaseat.eco-n-tech.co.uk/app/Models/Payment.php |
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Payment extends Model { use HasFactory; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'customer_id', 'seller_id', 'product_id', 'stripe_charge_id', 'amount', 'fees_collected', 'refunded', 'is_complete' ]; /** * Get the user that paid */ public function user() { return $this->belongsTo(User::class, 'customer_id', 'id'); } /** * Get the seller that sold */ public function seller() { return $this->belongsTo(User::class, 'seller_id', 'id'); } /** * Get the product that was bought */ public function product() { return $this->belongsTo(Product::class); } /** * Get the payment attached to this booking */ public function payment() { return $this->hasOne(Payment::class); } /** * Get the payment stripe charges */ public function charges() { return $this->hasMany(PaymentCharge::class); } /** * Get the payment stripe transfer */ public function transfer() { return $this->hasOne(PaymentTransfer::class); } }