jok3r
1 month ago

Encrypt value for relation Eloquent

Posted 1 month ago by jok3r

I have a problem with this project. I need to get the contact information of a lead, but the id in the contact table is 'encrypted' so I wanted to know how I could tell you that when I called that relationship I sent the encrypted id?

public function contact() { Helpers::virketEncrypt($this->id); // hasOne(RelatedModel, foreignKeyOnRelatedModel = lead_id, localKey = id) return $this->hasOne(LeadContact::class); }

Please sign in or create an account to participate in this conversation.