| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace JobApis\JobsToMail\Http\Controllers; |
||
| 18 | public function index(Request $request, $userId = null) |
||
| 19 | { |
||
| 20 | // Get the searches for this user (or specified in ID) |
||
| 21 | $results = $this->dispatchNow( |
||
| 22 | new GetUserSearches( |
||
| 23 | $userId ?: $request->session()->get('user.id') |
||
| 24 | ) |
||
| 25 | ); |
||
| 26 | |||
| 27 | if (!$results->isEmpty()) { |
||
| 28 | return view('searches.index', ['searches' => $results]); |
||
| 29 | } |
||
| 30 | |||
| 31 | return redirect('/'); |
||
| 32 | } |
||
| 33 | |||
| 46 |