| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 2 | public function index() |
|
| 18 | { |
||
| 19 | 2 | $title = trans('general.users'); |
|
| 20 | |||
| 21 | 2 | $dataset = User::select('id', 'name', 'email', 'created_at') |
|
| 22 | 2 | ->paginate($this->getItemsPerPage()); |
|
| 23 | |||
| 24 | 2 | if ($dataset->isEmpty()) { |
|
| 25 | 1 | $this->addFlashMessage(trans('general.no_users_in_database'), 'alert-danger'); |
|
| 26 | } |
||
| 27 | |||
| 28 | $viewData = [ |
||
| 29 | 2 | 'columns' => $this->userTableService->getColumns(), |
|
| 30 | 2 | 'dataset' => $dataset, |
|
| 31 | 2 | 'routeName' => $this->userTableService->getRouteName(), |
|
| 32 | 2 | 'title' => $title, |
|
| 33 | 2 | 'deleteMessage' => mb_strtolower(trans('general.user')).' '.mb_strtolower(trans('general.number')), |
|
|
|
|||
| 34 | ]; |
||
| 35 | |||
| 36 | 2 | return view('list', $viewData); |
|
| 37 | } |
||
| 54 |