jeudi 27 octobre 2016

Eloquent relationship with LIKE comparison

If I want an eloquent relationship e.g.

public function subscribed(){

    return $this->hasOne('App\Models\SuppressionList', 'email', 'email');

}

This makes a strict equality comparison so if the email attribute on the primary table was Email@gmail.com and the email attribute on the foreign table was email@gmail.com. Is there any way to create a loose relationship so that it would join records with a LIKE comparator opposed to =.

Cheers



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire