Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

frederikkunze's avatar

Check teams slug with custom validator

Hi,

I want to check if the slug of a team is colliding with a existing route. I plan to add routes for every team like {team-slug}.domain.tld and domain.tld/{team-slug}. I want to add this check with a custom validator but i can't find the existing slug validation. I know there must be some validation as a slug currently is unique and it gets formed by teamname.

0 likes
6 replies
frederikkunze's avatar

@PawelMysior I know that I can check against it being unique in database but as I did write I want to check agains existing routes too. Currently I can't find where existing validation is done.

frederikkunze's avatar
frederikkunze
OP
Best Answer
Level 3

Ok I finally found it. It is located here: /vendor/laravel/spark/src/Interactions/Settings/Teams/CreateTeam.php

pawelmysior's avatar

Oh, I didn't see that this was a Spark question. Sorry about that.

Cronix's avatar

Did you alter that file in /vendor? That will get overwritten with an upgrade since that's a composer package.

1 like
frederikkunze's avatar

@Cronix No I did overwrite it with my own CreateUser File which extends the one which is shipped with Spark to be sure that it is updatesave.

Please or to participate in this conversation.