2018-10-22 14:04:37 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2018-11-20 05:36:56 +01:00
|
|
|
use App\Utils\Traits\MakesHash;
|
2018-10-22 14:04:37 +02:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
2018-11-02 11:54:46 +01:00
|
|
|
class Proposal extends BaseModel
|
2018-10-22 14:04:37 +02:00
|
|
|
{
|
2018-11-20 05:36:56 +01:00
|
|
|
use MakesHash;
|
2018-10-22 14:04:37 +02:00
|
|
|
|
2018-11-20 05:36:56 +01:00
|
|
|
protected $guarded = [
|
|
|
|
'id',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $appends = ['proposal_id'];
|
|
|
|
|
|
|
|
public function getRouteKeyName()
|
|
|
|
{
|
|
|
|
return 'proposal_id';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getProposalIdAttribute()
|
2018-10-22 14:04:37 +02:00
|
|
|
{
|
2018-11-20 05:36:56 +01:00
|
|
|
return $this->encodePrimaryKey($this->id);
|
2018-10-22 14:04:37 +02:00
|
|
|
}
|
|
|
|
|
2019-04-28 07:31:32 +02:00
|
|
|
public function documents()
|
|
|
|
{
|
|
|
|
return $this->morphMany(Document::class, 'documentable');
|
|
|
|
}
|
2018-11-20 05:36:56 +01:00
|
|
|
|
2018-10-22 14:04:37 +02:00
|
|
|
}
|