2019-11-19 11:23:56 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2020-01-07 01:13:47 +01:00
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-11-19 11:23:56 +01:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
|
|
|
|
|
|
|
class Paymentable extends Pivot
|
|
|
|
{
|
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
|
|
|
}
|