Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add whereUlid(param) support for routing #45372

Merged
merged 1 commit into from Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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