コード例 #1
0
 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']));
 }
コード例 #2
0
 /**
  * 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);
 }