mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
34 lines
532 B
PHP
34 lines
532 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Task extends BaseModel
|
|
{
|
|
use MakesHash;
|
|
|
|
protected $guarded = [
|
|
'id',
|
|
];
|
|
|
|
protected $appends = ['task_id'];
|
|
|
|
public function getRouteKeyName()
|
|
{
|
|
return 'task_id';
|
|
}
|
|
|
|
public function getTaskIdAttribute()
|
|
{
|
|
return $this->encodePrimaryKey($this->id);
|
|
}
|
|
|
|
public function documents()
|
|
{
|
|
return $this->morphMany(Document::class, 'documentable');
|
|
}
|
|
|
|
}
|