0

我正在使用 Laravel 8 和 Inertia JS 和 VueJS 开始一个新项目。我正在使用 Inertia 生成的身份验证路由和视图,但在我的应用程序中我不需要/registerurl,所以我需要将其删除以避免其他人可以输入输入 URL。

我怎样才能删除它?或者管理 Inertia 生成的 url 的地方在哪里?或者例如,如果我不想删除 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

4

2 回答 2

0

他们似乎没有记录您如何做到这一点,但从 Fortify 配置文件中看起来是可行的。

打开config/fortify.php并评论或Features::registration(),从数组中删除:

use Laravel\Fortify\Features;

'features' => [
    // Features::registration(),
    // ...
],

于 2021-06-09T21:16:29.163 回答
0

检查路由下的 auth.php,你应该在那里找到所有的 auth 路由。因此,您可以重命名注册 url 以注册并创建新控制器或重命名注册用户控制器。

于 2021-06-12T22:07:06.927 回答