skip to Main Content

Laravel Eloquent for where Like

I'm trying to filter account in laravel.1 user can have many accounts with different format. It doesnt seem to work.The query: $accounts = $user->account()->where('account_no','like', ['34%','35%','3303%','3304%'])->get(); i'm wondering if this can be done or not?

VIEW QUESTION

Laravel eloquent find in array of objects column

I have a table called services with multiple columns and one column named staff_assigned with this content: [{"user_id":"15549","price":"100"},{"user_id":"15548","price":"300"},{"user_id":"15552","price":"95"},{"user_id":"15553","price":"600"}] How can I find all services where user_id is 15548 with Laravel eloquent? Note that Service::where('staff_assign->user_id', "15548")->get(); doesn't work because column contains…

VIEW QUESTION
Back To Top
Search