Swww18

395 经验值

我想自己写一个注册,登录来锻炼自己,不适用laravel make:auth默认生成的,注册登录,在写登录的时候遇到了点问题,一下是我的代码片段,我想通过Auth提供的attempt来实现验证

···
if(Auth::attempt([ 'username' => $request->username,'password' => $request->password])){

       //
        return redirect('/');
    }else{
        //
    }

···
报错内容
···
FatalThrowableError in EloquentUserProvider.php line 130:
Class 'AppUser' not found
···
后来我把那个auth.php 的model改成我自己写model的路径,
···
'providers' => [

    'users' => [
        'driver' => 'eloquent',
        'model' => App\Models\Home\Users::class,
    ],

···
但是又出现新的报错
···
FatalThrowableError in EloquentUserProvider.php line 114:
Type error: Argument 1 passed to IlluminateAuthEloquentUserProvider::validateCredentials() must be an instance of IlluminateContractsAuthAuthenticatable, instance of AppModelsHomeUsers given, called in /home/vagrant/Code/Blog/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php on line 385
···

上面大概的说类型错误,但是我传入的是数组,照文档上写的,还有一个问题就是auth.php,假如自己写改怎么配置,有没有相关的教程文档供参考之类的,多谢

我 user数据吧中用户名字段是username , 但是laravel中都是name,后来我把laravel中的name 都改成username,虽然可以提交到数据库中,但是用户名是空的,我把数据表中的username改成name,就可以成功提交,我想是不是除了,AuthController以及视图中的username,是不是还有其他的地方也有改字段名字啊?@JellyBool

教主,阿里的免费型的DV SSL,chrome 信任的过啊? namecheap 65一年的可以吗?

[crit] 4832#0: *7 connect() to unix:/var/run/php7.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 112.86.43.119, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7.1-fpm.sock:", host: "45.32.35.161"
请问下,我查看nginx的error.log我应该怎么去修改配置呢?

我按照站长的视频配置laravel的nginx环境,但是网页老是显示502 bad错误,我查看nginx显示的
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
好像是告诉我80端口被nginx重复绑定,请问nginx.conf配置里面改怎么配置IPV4和IPV6呢?
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
我自己的也是按照站长的配置的,启动nginx也是显示成功的?请问下改怎么解决呢