diff --git a/src/Http/Request.php b/src/Http/Request.php index e7850c8b..585fb5e9 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -38,9 +38,9 @@ class Request extends SymfonyRequest */ public function has($key) { - $value = $this->input($key); + $value = $this->input($key, null); - return !empty($value); + return !($value === null); } /** diff --git a/tests/Unit/Http/RequestTest.php b/tests/Unit/Http/RequestTest.php index 3f317367..a68f8b8f 100644 --- a/tests/Unit/Http/RequestTest.php +++ b/tests/Unit/Http/RequestTest.php @@ -47,7 +47,8 @@ class RequestTest extends TestCase ]); $this->assertTrue($request->has('foo')); - $this->assertFalse($request->has('bar')); + $this->assertTrue($request->has('bar')); + $this->assertFalse($request->has('baz')); } /**