| Conditions | 7 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php namespace Cornford\Notifier\Controllers; |
||
| 16 | public function index() |
||
| 17 | { |
||
| 18 | if ((Request::ajax() && Route::is('notifier.index')) || !Request::ajax()) { |
||
| 19 | Notifier::expireDisplayedNotifications(); |
||
| 20 | } |
||
| 21 | |||
| 22 | $notifications = Notifier::getDisplayNotifications(); |
||
| 23 | |||
| 24 | if ((Request::ajax() && Route::is('notifier.index')) || !Request::ajax()) { |
||
| 25 | Notifier::displayNotifications($notifications); |
||
| 26 | } |
||
| 27 | |||
| 28 | return Response::json(['notifications' => Notifier::toArray($notifications)]); |
||
| 29 | } |
||
| 30 | |||
| 31 | } |