@@ -17,8 +17,7 @@ |
||
| 17 | 17 | public function list_devices(Request $request) { |
| 18 | 18 | if ($request->user()->level >= 10 || $request->user()->level == 5) { |
| 19 | 19 | return Devices::all(); |
| 20 | - } |
|
| 21 | - else { |
|
| 20 | + } else { |
|
| 22 | 21 | return User::find($request->user()->user_id)->devices()->get(); |
| 23 | 22 | } |
| 24 | 23 | } |
@@ -42,6 +42,9 @@ |
||
| 42 | 42 | $this->setAttrib('sticky', $enabled); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param string $name |
|
| 47 | + */ |
|
| 45 | 48 | private function setAttrib($name, $enabled) { |
| 46 | 49 | if ($enabled === true) { |
| 47 | 50 | $read = new NotificationAttrib; |
@@ -17,8 +17,7 @@ |
||
| 17 | 17 | public function list_devices(Request $request) { |
| 18 | 18 | if ($request->user()->level >= 10 || $request->user()->level == 5) { |
| 19 | 19 | return Devices::all(); |
| 20 | - } |
|
| 21 | - else { |
|
| 20 | + } else { |
|
| 22 | 21 | return User::find($request->user()->user_id)->devices()->get(); |
| 23 | 22 | } |
| 24 | 23 | } |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | if ($type === 'archive') |
| 27 | 27 | { |
| 28 | 28 | $notifications = Notification::IsArchived($request)->get(); |
| 29 | - } |
|
| 30 | - else { |
|
| 29 | + } else { |
|
| 31 | 30 | $notifications = Notification::IsUnread()->get(); |
| 32 | 31 | } |
| 33 | 32 | return $notifications; |
@@ -44,15 +43,13 @@ discard block |
||
| 44 | 43 | |
| 45 | 44 | if ($action == 'read') { |
| 46 | 45 | $result = $notification->markRead($enable); |
| 47 | - } |
|
| 48 | - elseif ($action == 'sticky') { |
|
| 46 | + } elseif ($action == 'sticky') { |
|
| 49 | 47 | $result = $notification->markSticky(false); |
| 50 | 48 | } |
| 51 | 49 | |
| 52 | 50 | if ($result === false) { |
| 53 | 51 | return $this->response->errorInternal(); |
| 54 | - } |
|
| 55 | - else { |
|
| 52 | + } else { |
|
| 56 | 53 | return $this->response->array(array('statusText'=>'OK')); |
| 57 | 54 | } |
| 58 | 55 | } |