mysql - Eloquent select statement based on a condition in another table -


i have laravel eloquent select statement looks this:

$test = test::with(['a.b.companies']) .. , on

now, want return results query based on company names in companies table.

i tried write clause various trial , errors doesn't work. new laravel , mysql. in right direction good. thanks.

you may use where, more reference : - eloquent orm

$test = test::where('company_name1', '=', $company_name1)->orwhere('company_name2', '=', $company_name2)->get(); 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -