Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

merge two query results in laravel

$teamStanding = Ladder::getTeamPosition($request->competitionId, $request->id)->get();

$teamStatistics = TeamCompetitionStatistics::getTeamStats($request->competitionId, $request->id)->get();

$merged = $teamStatistics->merge($teamStanding);

$result = $merged->all();

// return [{'teamstanding': 'data', 'teamstatictics': 'data'}]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #merge #query #results #laravel
ADD COMMENT
Topic
Name
5+4 =