Skip to content

Commit

Permalink
Add whereUlid(param) support for routing (#45372)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamShady committed Dec 20, 2022
1 parent ca775d0 commit 672528e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -39,6 +39,17 @@ public function whereNumber($parameters)
return $this->assignExpressionToParameters($parameters, '[0-9]+');
}

/**
* Specify that the given route parameters must be ULIDs.
*
* @param array|string $parameters
* @return $this
*/
public function whereUlid($parameters)
{
return $this->assignExpressionToParameters($parameters, '[0-7][0-9a-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}');
}

/**
* Specify that the given route parameters must be UUIDs.
*
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Support/Facades/Route.php
Expand Up @@ -83,6 +83,7 @@
* @method static \Illuminate\Routing\RouteRegistrar whereAlpha(array|string $parameters)
* @method static \Illuminate\Routing\RouteRegistrar whereAlphaNumeric(array|string $parameters)
* @method static \Illuminate\Routing\RouteRegistrar whereNumber(array|string $parameters)
* @method static \Illuminate\Routing\RouteRegistrar whereUlid(array|string $parameters)
* @method static \Illuminate\Routing\RouteRegistrar whereUuid(array|string $parameters)
* @method static \Illuminate\Routing\RouteRegistrar whereIn(array|string $parameters, array $values)
* @method static \Illuminate\Routing\RouteRegistrar as(string $value)
Expand Down

0 comments on commit 672528e

Please sign in to comment.