简体   繁体   English

无法使用laravel auth登录/注册

[英]Can't use laravel auth login/register

I try to make a login/register simple app with laravel... I currently use 5.2 version of laravel. 我尝试使用laravel创建一个简单的登录/注册应用程序...我目前使用5.2版本的laravel。

At route I write: 在路线上,我写道:

Route::controllers([
     'auth'=>'Auth\AuthController',
     'password'=>'Auth\PasswordController', ]);

SO now when I try to register user at localhost:8888/auth/register - I fill fields but when I click register then I get error message: 所以现在当我尝试在localhost:8888 / auth / register上注册用户时-我填写了字段,但是当我单击register时我得到了错误消息:

FatalErrorException in User.php line 8: Class 'Illuminate\\Foundation\\Auth\\User' not found User.php第8行中的FatalErrorException:找不到类'Illuminate \\ Foundation \\ Auth \\ User'

在此处输入图片说明

So how I can use auth at laravel 5.2? 那么如何在laravel 5.2中使用auth? How I can downgrade laravel from 5.2 to 5.1 version? 如何将laravel从5.2降级到5.1版本? What you suggest? 你有什么建议? How I can solve my problem? 我该如何解决我的问题?

As per the error message no such class exists and therefore its throwing an exception. 根据错误消息,不存在此类,因此抛出异常。 Remove line 8 from your User model. 从用户模型中删除第8行。 I suspect the foundation class should be 我怀疑基础课应该是

use Illuminate\Foundation\Auth\Access\Authorizable;

but without seeing the code I'm guessing. 但没有看到我猜的代码。 I'd suggest posting your controller, route and view code for us to help you. 建议您发布您的控制器,路由和查看代码,以帮助我们。 Registration and auth are fairly straightforward so post the code and let's see how we can help. 注册和身份验证非常简单,因此发布代码,让我们看看如何提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM