public_id}"; } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function account() { return $this->belongsTo('App\Models\Account'); } /** * @return mixed */ public function invoice() { return $this->belongsTo('App\Models\Invoice')->withTrashed(); } /** * @return mixed */ public function invitations() { return $this->hasMany('App\Models\ProposalInvitation')->orderBy('proposal_invitations.contact_id'); } /** * @return mixed */ public function proposal_invitations() { return $this->hasMany('App\Models\ProposalInvitation')->orderBy('proposal_invitations.contact_id'); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function proposal_template() { return $this->belongsTo('App\Models\ProposalTemplate')->withTrashed(); } public function getDisplayName() { return $this->invoice->invoice_number; } } Proposal::creating(function ($project) { $project->setNullValues(); }); Proposal::updating(function ($project) { $project->setNullValues(); });