在Laravel 5.6中更改默认登录/注册URL

时间:2018-06-08 20:07:13

标签: php laravel laravel-5 laravel-5.6

我正在使用Laravel 5.6,开箱即用的登录/注册方法正是我所需要的。

我设法删除了烦人的" / public"通过重命名" myapp"的根目录上的server.php来对URL进行位将文件夹复制到index.php,然后将.htaccess文件从/ public文件夹复制到myapp的根目录。最后,我的网址如下所示:

http://localhost/myapp/index.php/login

http://localhost/myapp/index.php/register

现在,我想将这两个丑陋的网址翻译成:

http://localhost/myapp/login

http://localhost/myapp/register

我该怎么做?

3 个答案:

答案 0 :(得分:0)

<{1>}文件中的

routes/web.php

我相信它会起作用

答案 1 :(得分:0)

而不是如果你使用linux创建vhost并将你的根目录指向myapp / public。或者,如果您使用Windows,只需使用laragon即可。或者使用Vagrant,

答案 2 :(得分:0)

此代码段帮助我覆盖了所有身份验证网址或路由。

# convert the data frames to a list
library(purrr)
df_list <-map(namelist, ~ get(.x))


# function for the replacement
replace_nas <- function(df, col_no) {
  x <- df[col_no]

  x[is.na(x)] <- paste0("EMPTY_", 1:sum(is.na(x)))
  df[col_no] <- x
  df
}

tmp2 <- df_list %>% map(~ replace_nas(.x, col_no = 1))