@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | { |
14 | 14 | public function __construct() |
15 | 15 | { |
16 | - config(['auth.model' => \plunner\Planner::class]); |
|
17 | - config(['jwt.user' => \plunner\Planner::class]); |
|
16 | + config([ 'auth.model' => \plunner\Planner::class ]); |
|
17 | + config([ 'jwt.user' => \plunner\Planner::class ]); |
|
18 | 18 | $this->middleware('jwt.authandrefresh:mode-en'); |
19 | 19 | } |
20 | 20 | |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $this->authorize($group); |
33 | 33 | $meetings = $group->meetings(); |
34 | 34 | if ($request->query('current')) |
35 | - $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
36 | - $query->where('start_time', '=', NULL);//to be planned |
|
35 | + $meetings->where(function($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
36 | + $query->where('start_time', '=', NULL); //to be planned |
|
37 | 37 | //datetime to consider timezone, don't use mysql NOW() |
38 | - $query->orWhere('start_time', '>=', new \DateTime());//planned |
|
38 | + $query->orWhere('start_time', '>=', new \DateTime()); //planned |
|
39 | 39 | }); |
40 | 40 | |
41 | 41 | return $meetings->get(); |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | $meeting = Meeting::findOrFail($meetingId); |
91 | 91 | $this->authorize($meeting); |
92 | 92 | $input = $request->all(); |
93 | - if ($meeting->start_time != NULL && $meeting->duration == $input['duration']) |
|
94 | - return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422); |
|
93 | + if ($meeting->start_time != NULL && $meeting->duration == $input[ 'duration' ]) |
|
94 | + return Response::json([ 'error' => 'the meeting is already planned, you cannot change the duration' ], 422); |
|
95 | 95 | $meeting->update($input); |
96 | 96 | return $meeting; |
97 | 97 | } |
@@ -31,9 +31,11 @@ discard block |
||
31 | 31 | $group = Group::findOrFail($groupId); |
32 | 32 | $this->authorize($group); |
33 | 33 | $meetings = $group->meetings(); |
34 | - if ($request->query('current')) |
|
35 | - $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
36 | - $query->where('start_time', '=', NULL);//to be planned |
|
34 | + if ($request->query('current')) { |
|
35 | + $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
36 | + $query->where('start_time', '=', NULL); |
|
37 | + } |
|
38 | + //to be planned |
|
37 | 39 | //datetime to consider timezone, don't use mysql NOW() |
38 | 40 | $query->orWhere('start_time', '>=', new \DateTime());//planned |
39 | 41 | }); |
@@ -90,8 +92,9 @@ discard block |
||
90 | 92 | $meeting = Meeting::findOrFail($meetingId); |
91 | 93 | $this->authorize($meeting); |
92 | 94 | $input = $request->all(); |
93 | - if ($meeting->start_time != NULL && $meeting->duration == $input['duration']) |
|
94 | - return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422); |
|
95 | + if ($meeting->start_time != NULL && $meeting->duration == $input['duration']) { |
|
96 | + return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422); |
|
97 | + } |
|
95 | 98 | $meeting->update($input); |
96 | 99 | return $meeting; |
97 | 100 | } |