Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Authenticate | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 1 |
| redirectTo | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
20 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Middleware; |
| 4 | |
| 5 | use Illuminate\Auth\Middleware\Authenticate as Middleware; |
| 6 | use Illuminate\Support\Facades\Request; |
| 7 | |
| 8 | class Authenticate extends Middleware |
| 9 | { |
| 10 | /** |
| 11 | * Get the path the user should be redirected to when they are not authenticated. |
| 12 | * |
| 13 | * @param \Illuminate\Http\Request $request |
| 14 | * @return string|null |
| 15 | */ |
| 16 | protected function redirectTo($request) |
| 17 | { |
| 18 | if (! $request->expectsJson()) { |
| 19 | if (Request::segment(2) == 'dashboard' || Request::segment(1) == 'dashboard'){ |
| 20 | return route('dashboard.adminlogin'); |
| 21 | } |
| 22 | return route('dashboard.adminlogin'); |
| 23 | } |
| 24 | } |
| 25 | } |