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