| Conditions | 5 |
| Paths | 7 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 25 | public function verification(Request $request) |
||
| 26 | { |
||
| 27 | $request->validate([ |
||
| 28 | 'verfication_code' => 'required', |
||
| 29 | ]); |
||
| 30 | if ($request->has('verfication_code')) { |
||
| 31 | $credential = (session()->has('destination_password') ? session()->get('destination_password') : config('adminetic.default_bouncer_credential', 'adminetic')); |
||
| 32 | if ($request->verfication_code == $credential) { |
||
| 33 | $verified_routes = session()->get('verified_routes') ?? array(); |
||
| 34 | $destination_route = session()->has('destination_route') ? session()->get('destination_route') : url()->previous(); |
||
| 35 | array_push($verified_routes, $destination_route); |
||
| 36 | session()->put('verified_routes', array_unique($verified_routes)); |
||
| 37 | return redirect()->to($destination_route)->withSuccess('Verified Successfully'); |
||
| 38 | } else { |
||
| 39 | return redirect()->back()->withFail('Invalid Verfication Code'); |
||
| 40 | } |
||
| 44 |