Searching a trick for this issue How to use alias column in whereIn with Laravel?, I am trying:
$allowed_a = \App\NewA::select('name')->get()->pluck('name');
$a = App\A::whereRaw("replace(unaccent(trim(name)), ' ', '') IN ?", $allowed_a)->get();
But I am getting Invalid parameter number: parameter was not defined, because I need so many
?
as many elements in the table, but the I do not know the array lenght. How to deal with this? Thanks
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire