【发布时间】:2021-08-26 21:21:40
【问题描述】:
我正在使用 Laravel 8 和 Inertia JS 和 VueJS 开始一个新项目。我正在使用 Inertia 生成的身份验证路由和视图,但在我的应用程序中我不需要 /register url,因此我需要将其删除以避免其他人输入 URL。
我怎样才能删除它?或者管理 Inertia 生成的 url 的地方在哪里?或者例如,如果我不想删除网址,但我想将其重命名为/signup,我该怎么做?
我一直在惯性文档中寻找信息,但没有找到任何信息。
这是我的 web.php 路由文件,这些路由不在这里
<?php
use App\Http\Controllers\Experimental\RandomController;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return Inertia::render('Welcome', [
'canLogin' => Route::has('login'),
'canRegister' => Route::has('register'),
'laravelVersion' => Application::VERSION,
'phpVersion' => PHP_VERSION,
]);
});
Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
return Inertia::render('Dashboard');
})->name('dashboard');
更新 1: 我正在使用 Laravel Jetstream
【问题讨论】:
-
你在使用 Laravel Jetstream 吗?
-
是的,很抱歉。我忘了把它放在问题中。已更新。
标签: php laravel vue.js laravel-8 inertiajs