Skip to content

Installation instructions on Laravel 10 #108

@RasmusLindstrom

Description

@RasmusLindstrom

I tried to install this on Laravel 10, but the instructions don't match

  1. When I want to run this on specific pages, the instructions say to first open "app/Http/Kernel.php" and then "...you should instead add a new mapping to the routeMiddleware array", but there's no such array in that Kernel-file. I can find one in another Kernel.php, where there's an empty array. Should it be added there instead?

  2. Web.php seems to have a different format in Laravel 10 than last time I played around with Laravel, now a route in "web.php" looks like this: Route::get('/', function () { return view('index'); });

According to the docs, the way to do this would be: Route::middleware('page-cache')->get('/', 'PostController@index');
But that is not working. [Perhaps the issue here is that I implemented the middleware incorrectly in 1)]

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions