public function testStaticCall() { $config = array('realm' => '1', 'username' => '2', 'password' => '3'); $httpauth = Httpauth::make($config); $this->assertInstanceOf('\\Intervention\\Httpauth\\Httpauth', $httpauth); $this->assertEquals('1', $httpauth->realm); $this->assertTrue($httpauth->isValid($config['username'], $config['password'])); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $config = array('username' => 'admin', 'password' => '1234'); Httpauth::make($config)->secure(); return $next($request); }