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

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -