Skip to content

Update Laravel Documentation for Middleware in Laravel 11 #58

@JoshSalway

Description

@JoshSalway

Hi Torchlight Team,

With the release of Laravel 11, the middleware configuration process has changed significantly. Middleware registration is now handled in bootstrap/app.php rather than Http/Kernel.php. However, your current documentation still references the older Kernel.php approach, which can confuse developers working with Laravel 11.

See link:
https://torchlight.dev/docs/clients/laravel

Suggested Updates:

  1. Update the Middleware section to reflect the new process:
  • Register middleware using the withMiddleware method in bootstrap/app.php.
  • Highlight the usage of prepend to ensure the RenderTorchlight middleware runs at the correct point in the middleware stack.

Example snippet for Laravel 11:

use Torchlight\Middleware\RenderTorchlight;

->withMiddleware(function (Middleware $middleware) {
    $middleware->prepend(RenderTorchlight::class);
});
  1. Mention that the Http/Kernel.php approach is only relevant for Laravel versions prior to 11.
  2. Review other sections referencing middleware to ensure compatibility with Laravel 11.

Why This Matters:

Developers migrating to or starting with Laravel 11 might spend extra time troubleshooting if they follow outdated instructions. An updated guide will ensure a smoother integration experience for everyone.

Thank you for maintaining such a great tool, and I’d be happy to help with further testing or clarifications if needed.

Best regards,
Josh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions