首页 > 解决方案 > 此路由不支持 GET 方法。支持的方法:HEAD。- 拉拉维尔 8

问题描述

我刚刚用 jetstream 安装了 laravel 8,一切正常。我调用了登录和注册路由,它们也工作正常,但是当我访问根 url 时,它给了我这个错误。IE

The GET method is not supported for this route. Supported methods: HEAD.

不知道有什么问题我运行了很多命令

php artisan cache:clear
php artisan route:cache
php artisan view:cache
php artisan config:cache

我的路线有这个代码

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Artist\AlbumController;
use App\Http\Controllers\Artist\TrackController;
use App\Http\Controllers\Artist\DashboardController;
use App\Http\Controllers\Artist\ArtistController;

Route::get('/', function () { return view('login'); });

Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
    return view('dashboard');
})->name('dashboard');

不知道为什么我会收到此错误

标签: phplaravel

解决方案


推荐阅读