1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/app/Models/Expense.php
2019-05-07 15:08:10 +10:00

36 lines
592 B
PHP

<?php
namespace App\Models;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
class Expense extends BaseModel
{
use MakesHash;
protected $guarded = [
'id',
];
protected $dateFormat = 'Y-m-d H:i:s.u';
protected $appends = ['expense_id'];
public function getRouteKeyName()
{
return 'expense_id';
}
public function getExpenseIdAttribute()
{
return $this->encodePrimaryKey($this->id);
}
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
}