lundi 2 avril 2018

Why if the number of arrays = 1, whereIn does not work on the laravel?

I use laravel 5.6

My eloquent laravel like this :

public function list($status)
{
    return DB::table('orders')->whereIn('id', $status)->paginate(5);
}

Status parameter is dynamic

If $status = [1,2,3], it works

But if $status = [2], it does not works, the result null

So, if the number of arrays = 1, whereIn does not work

How can I solve this problem?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire