jeudi 14 septembre 2017

query returning wrong result for like'%'

like % not working . the query returning result for full string match not the substring match.

 Booking::whereHas('agent', function ($query) use ($agent_name) {
            $query->where('first_name', 'like', "'%".$agent_name."%'");
    })->select('id','agent_id','file_number','title','first_name','last_name','ref_number','pax_adult','pax_child')->with(array('agent'=>function($query){
        $query->select('id','first_name','last_name');
    }))->get();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire