Skip to content

Blank white page when using withRouting(... then:) custom routes in Laravel 12.42.0 #58146

@iamsoboy

Description

@iamsoboy

Laravel Version

12.42.0

PHP Version

8.4.14

Database Driver & Version

No response

Description

Description

After updating to Laravel 12.42.0, custom routes registered using the then callback inside withRouting() result in a blank white page (no response, no error, no 404), even though the route exists and is correctly defined.

This follows the official Laravel documentation for routing customization, but the behavior appears broken after a recent composer update.

Laravel Version
12.42.0

PHP Version
PHP 8.4.14

Framework Stack

  • Laravel 12
  • Inertia.js v2.0
  • Vue 3

Expected Behavior
The custom route should return its defined response.

Example route:
Route::get('greeting', function () {
return 'Hello World Administrator';
});

Visiting:
https://example.test/webhooks/greeting

Should return:
Hello World Administrator

Actual Behavior
The page loads as a blank white screen:

  • No HTTP error
  • No exception
  • No 404
  • No output
  • No logs written
    The request silently fails.

Steps To Reproduce

  1. Update to Laravel 12.42.0

  2. Configure routing using withRouting() as documented:
    use Illuminate\Support\Facades\Route;

->withRouting(
web: DIR.'/../routes/web.php',
commands: DIR.'/../routes/console.php',
health: '/up',
then: function () {
Route::middleware('web')
->prefix('webhooks')
->group(base_path('routes/webhooks.php'));
},
)

  1. Create routes/webhooks.php:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions