@@ -23,11 +23,11 @@ |
||
23 | 23 | */ |
24 | 24 | public function events() |
25 | 25 | { |
26 | - $projects = Project::where('is_archived', 0)->with(['events' => function ($query) { |
|
26 | + $projects = Project::where('is_archived', 0)->with(['events' => function($query) { |
|
27 | 27 | $query->where('end_date', '>=', new \DateTime())->orderBy('start_date', 'ASC'); |
28 | 28 | }, 'events.location'])->get(); |
29 | 29 | |
30 | - $currentProjects = $projects->filter(function ($project) { |
|
30 | + $currentProjects = $projects->filter(function($project) { |
|
31 | 31 | return $project->events->count() > 0; |
32 | 32 | })->all(); |
33 | 33 |
@@ -29,11 +29,11 @@ |
||
29 | 29 | $deadline = new \DateTime(); |
30 | 30 | $deadline->add(new \DateInterval('PT2H')); |
31 | 31 | |
32 | - $projects = Project::where('is_archived', 0)->with(['events' => function ($query) use ($deadline) { |
|
32 | + $projects = Project::where('is_archived', 0)->with(['events' => function($query) use ($deadline) { |
|
33 | 33 | $query->where('start_date', '>=', $deadline)->orderBy('start_date', 'ASC'); |
34 | 34 | }, 'events.location'])->get(); |
35 | 35 | |
36 | - $currentProjects = $projects->filter(function ($project) { |
|
36 | + $currentProjects = $projects->filter(function($project) { |
|
37 | 37 | return $project->events->count() > 0; |
38 | 38 | })->all(); |
39 | 39 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | ->get(); |
64 | 64 | |
65 | 65 | // Iterate over all events and fill in the values for each fetched header |
66 | - foreach( $this->events as $event ) { |
|
66 | + foreach ($this->events as $event) { |
|
67 | 67 | $eventResults = []; |
68 | 68 | |
69 | 69 | $eventResults['date'] = $event->start_date; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | ->count(); |
75 | 75 | |
76 | 76 | // Get ticket category stats |
77 | - foreach( $priceCategories as $cat) { |
|
77 | + foreach ($priceCategories as $cat) { |
|
78 | 78 | // Get the number of tickets sold of this category |
79 | 79 | $eventResults[$cat->name . '_total'] = with(clone $viewQuery)->where('tickets.event_id', $event->id) |
80 | 80 | ->where('purchases.state', 'paid') |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $eventResults['total_sum'] = with(clone $viewQuery)->where('tickets.event_id', $event->id)->sum('price_categories.price'); |
98 | 98 | |
99 | 99 | // Get the sales for each vendor |
100 | - foreach( $vendors as $vendor ) { |
|
100 | + foreach ($vendors as $vendor) { |
|
101 | 101 | $eventResults[$vendor->name . '_sum'] = with(clone $viewQuery)->where('tickets.event_id', $event->id) |
102 | 102 | ->where('purchases.vendor_id', $vendor->id) |
103 | 103 | ->sum('price_categories.price'); |