Create Complex Laravel Query

Job ID: 31343750

Budget: $10 – $30 USD

I need to query some info in Laravel as per the below description;

Model(Standing)
-league_id
-team_id
-overall_league_position

Model(Fixture)
-league_id
-fixture_hometeam_id (similar to team_id above)
-fixture_awayteam_id (similar to team_id above)
-fixture_hometeam_ft_score
-fixture_awayteam_ft_score
-fixture_date

Variables
-$a
-$b
-$c
-$d
-$e
-$f
-$g


Query description

Return fixtures
-between two dates
-with head to head fixtures
-with home team fixtures
-with away team fixtures
-where minimum overall_league_position difference of $a between the teams
-where head to head total scores (fixture_hometeam_ft_score + fixture_awayteam_ft_score) is not less than $b for latest $c fixtures
-where fixture_hometeam_ft_score is not less than $d for the latest $e fixtures (for both home and away games)
-where fixture_awayteam_ft_score is not less than $f for the latest $g fixtures (for both home and away games)