This is the code from my Laravel
application:
public function sendNotifications()
{
$matchingSubscriptions = DB::table('tournament_match_plan')
->join('push_subscriptions', 'push_subscriptions.age_group', '=', 'tournament_match_plan.league')
->where('tournament_match_plan.start', '=', '11:20:00')
->where('tournament_match_plan.team_1', '=', 'push_subscriptions.club')
->orwhere('tournament_match_plan.team_2', '=', 'push_subscriptions.club')
->get();
dd($matchingSubscriptions);
}
Here is the debug message:
Illuminate\Support\Collection {#751 ▼ // app\Http\Controllers\Guests\GuestsPushController.php:97
#items: []
#escapeWhenCastingToString: false
}
Why don't I get any result from my Laravel
Code?
I've tried the same query in phpMyAdmin
:
SELECT *
FROM tournament_match_plan
JOIN push_subscriptions ON push_subscriptions.age_group = tournament_match_plan.league
WHERE tournament_match_plan.start = '11:20:00'
AND (tournament_match_plan.team_1 = push_subscriptions.club OR tournament_match_plan.team_2 = push_subscriptions.club);
With the above code, I get the correct result.