| Conditions | 4 |
| Paths | 4 |
| Total Lines | 26 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function __invoke(Request $request) |
||
| 20 | { |
||
| 21 | // Determine if there are any Dashboard Tools that need to be loaded |
||
| 22 | $modules = Module::allEnabled(); |
||
| 23 | $tools = []; |
||
| 24 | foreach($modules as $module) |
||
| 25 | { |
||
| 26 | $name = $module->getLowerName(); |
||
| 27 | $toolData = config($name.'.dashboard_tool'); |
||
| 28 | |||
| 29 | if($toolData) |
||
| 30 | { |
||
| 31 | foreach($toolData as $data) |
||
| 32 | { |
||
| 33 | $tools[] = $data; |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | return Inertia::render('Home/Dashboard', [ |
||
| 39 | 'notifications' => $request->user()->notifications, |
||
| 40 | 'bookmarks' => [ |
||
| 41 | 'customers' => UserCustomerBookmark::where('user_id', $request->user()->user_id)->get(), |
||
| 42 | 'tips' => UserTechTipBookmark::where('user_id', $request->user()->user_id)->get(), |
||
| 43 | ], |
||
| 44 | 'tools' => $tools, |
||
| 45 | ]); |
||
| 48 |