Skip to content

Commit 56e9245

Browse files
authored
Merge pull request #3258 from tusharnain/feature/request-isset
Add __isset() method to Request class for attribute existence check
2 parents e2c8526 + 33f44d4 commit 56e9245

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Utilities/Request.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ public function __call($name, $arguments)
2424
}
2525
}
2626

27+
/**
28+
* Determine if an attribute exists on the base request.
29+
*
30+
* @param string $name
31+
*/
32+
public function __isset($name): bool
33+
{
34+
return isset(request()->$name);
35+
}
36+
2737
/**
2838
* Get attributes from request instance.
2939
*

0 commit comments

Comments
 (0)