Laravel 5.5 如何禁用用户注册


app/Http/Controllers/Auth/RegisterController.php中重写两个函数,如下:


/**
 * Show the application registration form.
 *
 * @return \Illuminate\Http\Response
 */
public function showRegistrationForm()
{
    return redirect('login');
}

/**
 * Handle a registration request for the application.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
public function register(Request $request)
{
    abort(404);
}

相应的,要删除view中注册的链接。











你可能感兴趣的:(PHP,Laravel,Lumen)