Closed K2ouMais closed 1 year ago
Hello everyone,
I am using a route like this:
/api/user?filter[userId]=1,2,3
In the controller I use a scope to query the id.
AllowedFilter::scope('userId')
The scope in the model:
public function scopeUserId(Builder $query, $id): Builder { dd($id); // output: 1 return $query->where('id', $id); }
The output of dd($id) seems to only be the first value of the comma separated list.
dd($id)
Is this correct? What am I doing wrong? I am expecting it to be 1,2,3.
1,2,3
Thank you in advance.
Hello everyone,
I am using a route like this:
/api/user?filter[userId]=1,2,3
In the controller I use a scope to query the id.
The scope in the model:
The output of
dd($id)
seems to only be the first value of the comma separated list.Is this correct? What am I doing wrong? I am expecting it to be
1,2,3
.Thank you in advance.