Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

DB::table('collections')->where(function ($q) { $q->where('type', '1')->whereIn('user_id', []); })->orWhere(function ($q) { $q->where('type', '2')->whereIn('user_id', []); })->lists('id')

Last updated 1 year ago.
0

kapv89 said:


DB::table('collections')->where(function ($q) { $q->where('type', '1')->whereIn('user_id', []); })->orWhere(function ($q) { $q->where('type', '2')->whereIn('user_id', []); })->lists('id')

How did you do that? How is function ($q) used? Thanks by the way :)

Last updated 1 year ago.
0

@RainbowHat, that is an anonymous function

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.