We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d7c7a4 commit 6cb52b2Copy full SHA for 6cb52b2
src/Illuminate/Http/Request.php
@@ -208,13 +208,7 @@ public function is(...$patterns)
208
{
209
$path = $this->decodedPath();
210
211
- foreach ($patterns as $pattern) {
212
- if (Str::is($pattern, $path)) {
213
- return true;
214
- }
215
216
-
217
- return false;
+ return collect($patterns)->contains(fn ($pattern) => Str::is($pattern, $path));
218
}
219
220
/**
@@ -238,13 +232,7 @@ public function fullUrlIs(...$patterns)
238
232
239
233
$url = $this->fullUrl();
240
234
241
242
- if (Str::is($pattern, $url)) {
243
244
245
246
247
235
+ return collect($patterns)->contains(fn ($pattern) => Str::is($pattern, $url));
248
236
249
237
250
0 commit comments