for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sco\Admin\Middleware;
use Auth;
use Closure;
use Illuminate\Http\Request;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle(Request $request, Closure $next, $guard = null)
$guard
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
if (Auth::guard(config('admin.guard'))->check()) {
return redirect()->route('admin.index');
}
return $next($request);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.