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

bufferoverflow's avatar

Adding a ::domain() condition to Spark routes

I need to add a ::domain('myapp.com') condition to the Spark routes file in routes.php.

// i need to turn this:
$router->group(['middleware' => Laravel\Spark\Spark::mustVerifyEmail() ? ['web', 'verified'] : 'web'], function ($router) {

// into this:
$router::domain('myapp.com')->group(['middleware' => Laravel\Spark\Spark::mustVerifyEmail() ? ['web', 'verified'] : 'web'], function ($router) {

Any way to do it without copying the whole content of /src/Http/routes.php to web.php?

0 likes
0 replies

Please or to participate in this conversation.