我不明白为什么当我导航到我的Laravel项目的管理员登录页面时会出现上述错误.拉威尔版本是7x.我怎么才能解决这个问题呢?

enter image description here

<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;


class LoginController extends Controller
{
    use AuthenticatesUsers;

    /**
     * Where to redirect admins after login.
     *
     * @var string
     */
    protected $redirectTo = '/admin';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest:admin')->except('logout');
    }

    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function showLoginForm()
    {
        return view('admin.auth.login');
    }
}

推荐答案

好的,如果有人出现这个错误,这是因为以下原因:

All authentication scaffolding has been moved to the laravel/ui repository. If you are using Laravel's authentication scaffolding, you should install the ^2.0 release of this package and the package should be installed in all environments.

因此,要解决此错误,只需在laravel应用程序的根文件夹上运行composer命令:

composer require laravel/ui "^2.0"

Or simply run:

composer require laravel/ui

Hope this helps.

Laravel相关问答推荐

Laravel-如何按第三表关系对数据进行分类

拉威尔望远镜没有显示请求细节

如何在自引用表上使用 Laravel 的 hasManyThrough

Laravel 从 5.1 升级到 5.2.0 错误

Laravel created_at 返回对象代替数据库中的日期格式?

如何为路由 laravel 5 使用OR中间件

Laravel 5.1 如何在Blade 文件上使用 {{ old('') }} 助手进行无线电输入

Laravel 使用 Storage::put 生成唯一 ID

如何仅从 laravel FormRequest 中获取经过验证的数据?

使用 laravel eloquent 关系检索除 NULL 之外的所有记录

如何将 Facebook PHP SDK 与 Laravel 5.4 集成?

如何在不使用视图的情况下使用 Laravel 4 发送Electron邮件?

Laravel php artisan 服务于模仿 HTTPS

Laravel 获取查询字符串

Lumen/Laravel 6:调用未定义的函数 array_except()

Laravel 单元测试依赖注入

Laravel 中的 isDirty() 是什么意思?

开发中的 Laravel 和视图缓存 - 无法立即看到更改

Laravel:如何在 PhpUnit 上启用堆栈跟踪错误

laravel中的动态网址?