@@ -2,15 +2,12 @@ |
||
2 | 2 | |
3 | 3 | namespace plunner\Http\Controllers\Employees\Planners; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | -use plunner\Employee; |
|
7 | -use plunner\Http\Requests; |
|
8 | -use plunner\Meeting; |
|
5 | +use Illuminate\Support\Facades\Response; |
|
9 | 6 | use plunner\Group; |
10 | -use plunner\MeetingTimeslot; |
|
11 | 7 | use plunner\Http\Controllers\Controller; |
12 | 8 | use plunner\Http\Requests\Employees\MeetingTimeslotRequest; |
13 | -use Illuminate\Support\Facades\Response; |
|
9 | +use plunner\Meeting; |
|
10 | +use plunner\MeetingTimeslot; |
|
14 | 11 | |
15 | 12 | |
16 | 13 | class MeetingTimeslotsController extends Controller |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function __construct() |
22 | 22 | { |
23 | - config(['auth.model' => \plunner\Planner::class]); |
|
24 | - config(['jwt.user' => \plunner\Planner::class]); |
|
23 | + config([ 'auth.model' => \plunner\Planner::class ]); |
|
24 | + config([ 'jwt.user' => \plunner\Planner::class ]); |
|
25 | 25 | $this->middleware('jwt.authandrefresh:mode-en'); |
26 | 26 | } |
27 | 27 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | if ($meeting->group_id == $groupId) |
41 | 41 | return $meeting->timeslots; |
42 | - return Response::json(['error' => 'meeting->group_id <> groupId'], 403); |
|
42 | + return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) |
63 | 63 | return $timeslot; |
64 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
64 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $timeslot = $meeting->timeslots()->create($input); |
84 | 84 | return $timeslot; |
85 | 85 | } |
86 | - return Response::json(['error' => 'meeting->group_id <> groupId'], 403); |
|
86 | + return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $timeslot->update($input); |
108 | 108 | return $timeslot; |
109 | 109 | } |
110 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
110 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -131,6 +131,6 @@ discard block |
||
131 | 131 | $timeslot->delete(); |
132 | 132 | return $timeslot; |
133 | 133 | } |
134 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
134 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
135 | 135 | } |
136 | 136 | } |
@@ -37,8 +37,9 @@ discard block |
||
37 | 37 | $meeting = Meeting::findOrFail($meetingId); |
38 | 38 | $this->authorize($meeting); |
39 | 39 | |
40 | - if ($meeting->group_id == $groupId) |
|
41 | - return $meeting->timeslots; |
|
40 | + if ($meeting->group_id == $groupId) { |
|
41 | + return $meeting->timeslots; |
|
42 | + } |
|
42 | 43 | return Response::json(['error' => 'meeting->group_id <> groupId'], 403); |
43 | 44 | } |
44 | 45 | |
@@ -59,8 +60,9 @@ discard block |
||
59 | 60 | $timeslot = MeetingTimeslot::findOrFail($timeslotId); |
60 | 61 | $this->authorize($timeslot); |
61 | 62 | |
62 | - if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) |
|
63 | - return $timeslot; |
|
63 | + if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) { |
|
64 | + return $timeslot; |
|
65 | + } |
|
64 | 66 | return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
65 | 67 | } |
66 | 68 |
@@ -32,14 +32,14 @@ |
||
32 | 32 | * |
33 | 33 | * @var array |
34 | 34 | */ |
35 | - protected $fillable = ['time_start', 'time_end']; |
|
35 | + protected $fillable = [ 'time_start', 'time_end' ]; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * The attributes excluded from the model's JSON form. |
39 | 39 | * |
40 | 40 | * @var array |
41 | 41 | */ |
42 | - protected $hidden = ['pivot', 'meeting']; |
|
42 | + protected $hidden = [ 'pivot', 'meeting' ]; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |