textlaravel记住用户(代码片段)

author author     2022-12-02     213

关键词:

Remembering Users
If you would like to provide "remember me" functionality in your application, you may pass a boolean value as the second argument to the attempt method, which will keep the user authenticated indefinitely, or until they manually logout. Of course, your users table must include the string remember_token column, which will be used to store the "remember me" token.

if (Auth::attempt(['email' => $email, 'password' => $password], $remember)) 
    // The user is being remembered...

If you are using the built-in LoginController that is shipped with Laravel, the proper logic to "remember" users is already implemented by the traits used by the controller.

If you are "remembering" users, you may use the viaRemember method to determine if the user was authenticated using the "remember me" cookie:

if (Auth::viaRemember()) 
    //

textlaravel登录用户名或电子邮件(代码片段)

查看详情

textlaravel消息(代码片段)

查看详情

textlaravel工厂创建(代码片段)

查看详情

textlaravel刀片命令(代码片段)

查看详情

textlaravel-删除包裹(代码片段)

查看详情

textlaravel数字海洋(代码片段)

查看详情

textlaravel持续整合(代码片段)

查看详情

textlaravel管理面板(代码片段)

查看详情

textlaravel最佳实践(代码片段)

查看详情

textlaravel表单错误(代码片段)

查看详情

textlaravel还原迁移(代码片段)

查看详情

textlaravel错误消息(代码片段)

查看详情

textlaravel插件和其他...(代码片段)

查看详情

textlaravel碳格式日期(代码片段)

查看详情

textlaravel创建登录注册(代码片段)

查看详情

textlaravel关系和同步(代码片段)

查看详情

textlaravel/phpsso书签(代码片段)

查看详情

textlaravel路线页面slug(代码片段)

查看详情