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
Post a Comment