Root Zanli
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
o5t6x7pgljbm
/
public_html
/
admin
/
app
/
Http
/
Middleware
/
Filename :
Authenticate.php
back
Copy
<?php namespace App\Http\Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware; use Auth; class Authenticate extends Middleware { /** * Get the path the user should be redirected to when they are not authenticated. * * @param \Illuminate\Http\Request $request * @return string|null */ protected function redirectTo($request) { if (!$request->expectsJson() && Auth::guard('Admin')->check() && ($request->segment(1) == 'admin')) { abort(302, '', ['Location' => route('admin.login')]); } if (! $request->expectsJson()) { if($request->segment(1) == 'admin'){ abort(302, '', ['Location' => route('admin.login')]); } } } }