你好,在拉拉维尔,我已经实现了护照认证,我需要允许我的一些路线,为未经认证的用户。我从堆栈溢出中获得了答案,但它显示了以下错误Declaration of App\Http\Middleware\Authenticate::authenticate(array $guards) must be compatible with Illuminate\Auth\Middleware\Authenticate::authenticate($request, array $guards)
我已经通过下面的链接实现了双因素身份验证。
https://github.com/antonioribeiro/google2fa
它对我来说很好。我的问题是在google2fa中,有一行。
To use the two factor authentication, your user will have to install a Google Authenticator compatible app.
如何使每个用户安装此应用程序,然后只有你会得到谷歌认证器2因素认证码。
有没有可能。以及如何在laravel中通过OTP实现双因素认证。即。OTP通过短信发送。请解释一下怎么做?
提前谢谢。
我的用户迁移是:
$table->increments('id');
$table->integer('matricula')->unique();
$table->timestamps();
用户通过“matricula”登录,我在我的应用程序中不需要密码,但是模型用户“强制”使用密码:
class User extends Eloquent implements UserInterface, RemindableInterface {
...
public function getAuthPassword()
{
我有一个Laravel 6应用程序,它在数据库中为前端用户提供了一个表。用户有一家公司的列。我有几个用户对一家公司有相同的价值。如何创建对数据库的查询,并询问与认证用户具有相同公司字段的用户?
例如:
$contacts = DB::table('users')->where(field company is like the field company of the authenticated user)->get()
不然呢?
我目前正在努力了解Laravel是如何运作的。我最大的问题是认证过程。假设我有一个管理面板和一个用户面板。我在"user_type“的”user“表中有一列,1= normal user和2= admin user。当用户登录到用户登录表单时,laravel将检查用户信息,并确保正常用户登录的类型为1。如果是,则设置会话。但是如何检查登录的用户是管理用户还是普通用户。任何帮助都是非常感谢的!
我通过一个restful来验证我的身份验证,如果它成功的话,它会给我用户名,然后我会尝试登录到我的Laravel应用程序。当我完成登录时,它看起来很有效。然而,它似乎没有保持会话,因为我在网站上导航,我仍然是作为一个客人认证。
public function login(){
// I do a guzzle request that gives me the value of $response['username']
$Username = $response['username'];
$user = User::where('
关于laravel认证是基于用户的,但我已经删除了用户模型,并将其替换为公司模式,因此,基本上,我希望我的用户(laravel身份验证用户)是公司。
拉勒维尔不喜欢这个,这给了我
Type error: Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\company given, called in /home/dhiraj1site/Desktop/Docume