did you run migrations? the error simply says that table session doesn't exist. this is because , from v11 session driver is changed to 'database' from 'file' so it's necessary to have session table in your database.
May 8, 2024
3
Level 4
Middleware does not work on laravel 11
I had used the same code on Laravel 10 which worked well but on a different project that is built on Laravel 11, shows a database error.
When the page does not need data from the database it should not show the error, but it says table session does not exist.
I used the bootstrap/app.php
->withMiddleware(function (Middleware $middleware) {
$middleware->alias([
'disableInstall' => \App\Http\Middleware\CheckMigrations::class,
]);
})
route:
Route::group(['prefix' => 'install', 'middleware' => 'disableInstall'], function() {
Route::get('/', [DatabaseManagementController::class, 'dbclick'])->name('db.click');
// other routes
});
Please or to participate in this conversation.