Answer the question
In order to leave comments, you need to log in
Selecting two fields at once in Laravel?
I have a table with the following structure
id
sell_user_id
buy_user_id
$trades = $trades->where(function($query) use ($request) {
$query->where('trades.sell_user_id', $request->user()->id)->orWhere('trades.buy_user_id', $request->user()->id);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question