@rsy644 Hey robert, did you run php artisan route:clear
Try to run php artisan server if route:clear dont work.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there, I am attempting to upgrade a laravel app I have from version 8.x to 9.x. I have updated my composer.json file with the new versions:
laravel/framework to ^9.0
nunomaduro/collision to ^6.1
and I have run composer update. However, when accessing the home page of my site now, I run into the following error message: The GET method is not supported for route /. Supported methods: HEAD.
I have tried running php artisan optimize, and php artisan route:cache, but to no effect.
Here is my routes file, and the body of my main controller:
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\AdminController;
use App\Http\Controllers\SubscriptionController;
use App\Http\Controllers\MailController;
Route::get('/', [ProductController::class, 'index'])->name('products.index');
Route::get('/create/{id}', [ProductController::class, 'create'])->name('products.create');
etc.
Controller:
<?php
namespace App\Http\Controllers;
use App\Models\Product;
use App\Models\Customer;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class ProductController
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
* @method('GET')
*/
public function index()
{
$products = Product::all();
return view('products.index')->with('products', $products);
}
I would be grateful as to any suggestions as to how to resolve this.
Thanks,
Robert
Please or to participate in this conversation.