encodePrimaryKey($this->id); } protected $hidden = [ 'password', 'remember_token', ]; protected $fillable = [ 'first_name', 'last_name', 'phone', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4', 'email', 'avatar', ]; /**/ public function getRouteKeyName() { return 'contact_id'; } public function getContactIdAttribute() { return $this->encodePrimaryKey($this->id); } public function client() { return $this->belongsTo(Client::class); } public function primary_contact() { return $this->where('is_primary', true); } public function company() { return $this->belongsTo(Company::class); } public function user() { return $this->belongsTo(User::class); } public function sendPasswordResetNotification($token) { $this->notify(new ClientContactResetPassword($token)); } }