I'm trying to change the default login view, from Laravel Auth. Earlier suggestions points at modifying the path inside of the corresponding controller, under /vendor. However, this is a cooperative project, so modifying the vendor files is not an option.

By default the view for Auth login is auth.login, but i want it to be backend.pages.login.

In which other way can i accomplish this?

我还try 在路由中手动添加视图路由,但无论我如何连接,它都无法将Auth识别为一个类.

注:它是Laravel 5.3

提前谢谢

推荐答案

App\Http\Controllers\Auth\LoginController中,将名为showLoginForm()函数定义为:

public function showLoginForm()
{
    return view('custom.login');
}

It overrides the function showLoginForm defined in the trait Illuminate\Foundation\Auth\AuthenticatesUsers.

102: In Laravel 5.3 the function name is changed from 100 to 101.

Laravel相关问答推荐

当未通过验证的字段是值数组时,Laravel$validator->;validator()方法不会引发异常

密码确认在Livewire中不匹配

Inertiajs - 使用链接组件添加记录但无法在不使用表单的情况下清除文本区域

使用 Amazon S3 的 Storage::get() 返回 false

Laravel 5.4 中的自定义助手类

laravel 控制器中的全局变量

Laravel 4:验证前修剪输入的最佳实践

限制 Blade foreach 循环中的结果

Laravel 的 APP_ENV 变量(在 .env 文件中找到)是否有建议的值列表?

如果用户在 Laravel 中经过身份验证,如何签入 Vue 组件?

在 Laravel 中下载后如何重定向?

Laravel 5.4 - 注册后禁用自动登录

如何处理 laravel 5 中的私有图像?

Laravel 5:在同一字符串上使用 bcrypt 给出不同的值

如果值存在于另一个字段数组中,Laravel 验证规则

Laravel 5 Carbon 全局语言环境

如何在 Laravel 视图中找到当前语言?

Laravel 验证存在于不存在的地方

如何使 Laravel (Blade) 文本字段只读

Distinct values with pluck