invoiceninja/app/Models/Payment.php

38 lines
628 B
PHP
Raw Normal View History

<?php
namespace App\Models;
2019-05-03 17:57:55 +10:00
use App\Models\Filterable;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
class Payment extends BaseModel
{
use MakesHash;
2019-05-03 17:57:55 +10:00
use Filterable;
protected $guarded = [
'id',
];
2019-05-03 17:57:55 +10:00
public function client()
{
return $this->belongsTo(Client::class);
}
2019-05-03 17:57:55 +10:00
public function company()
{
2019-05-03 17:57:55 +10:00
return $this->belongsTo(Company::class);
}
2019-05-03 17:57:55 +10:00
public function user()
{
2019-05-03 17:57:55 +10:00
return $this->belongsTo(User::class);
}
2019-04-28 15:31:32 +10:00
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
}