2019-11-19 11:23:56 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-11-19 11:23:56 +01:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2023-01-28 23:21:40 +01:00
|
|
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-11-19 11:23:56 +01:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-11-19 11:23:56 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
2020-11-15 22:23:20 +01:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2019-11-19 11:23:56 +01:00
|
|
|
|
2023-03-08 08:33:42 +01:00
|
|
|
/**
|
|
|
|
* App\Models\Paymentable
|
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property int $payment_id
|
|
|
|
* @property int $paymentable_id
|
|
|
|
* @property string $amount
|
|
|
|
* @property string $refunded
|
|
|
|
* @property string $paymentable_type
|
|
|
|
* @property int|null $created_at
|
|
|
|
* @property int|null $updated_at
|
|
|
|
* @property int|null $deleted_at
|
|
|
|
* @property-read \App\Models\Payment $payment
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $paymentable
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable newModelQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable newQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable onlyTrashed()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable query()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereAmount($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereDeletedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable wherePaymentId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable wherePaymentableId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable wherePaymentableType($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereRefunded($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereUpdatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable withTrashed()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Paymentable withoutTrashed()
|
|
|
|
* @mixin \Eloquent
|
|
|
|
*/
|
2019-11-19 11:23:56 +01:00
|
|
|
class Paymentable extends Pivot
|
|
|
|
{
|
2020-11-15 22:23:20 +01:00
|
|
|
use SoftDeletes;
|
|
|
|
|
2019-12-16 12:34:38 +01:00
|
|
|
protected $table = 'paymentables';
|
2020-01-07 01:13:47 +01:00
|
|
|
|
|
|
|
//protected $dateFormat = 'Y-m-d H:i:s.u';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that should be cast to native types.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $casts = [
|
|
|
|
'updated_at' => 'timestamp',
|
|
|
|
'created_at' => 'timestamp',
|
|
|
|
'deleted_at' => 'timestamp',
|
|
|
|
'settings' => 'object',
|
|
|
|
];
|
2020-01-29 03:03:47 +01:00
|
|
|
|
|
|
|
public function paymentable()
|
|
|
|
{
|
|
|
|
return $this->morphTo();
|
|
|
|
}
|
2020-04-08 12:48:31 +02:00
|
|
|
|
|
|
|
public function payment()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Payment::class);
|
|
|
|
}
|
2019-12-30 22:59:12 +01:00
|
|
|
}
|