当前位置:网站首页>Laravel 8 realizes auth login
Laravel 8 realizes auth login
2022-06-24 14:27:00 【s_ Canned ice】
notes : stay Use auth Login time , The password must be encrypted in the database , and
auth Login must use username and password. Encryption password can use the function bcrypt() To encrypt .
1. The background controller performs authentication login .
// Receive the transmitted value
$username = $request->post('username');
$password = $request->post('password');
$catch = $request->post('catch');
// Verify by verifier
$validatedData = $request->validate([
'username' => 'required',
'password' => 'required',
]);
// Use auth Do login verification
$res = Auth::attempt($validatedData);
if ($res) {
// Log in successfully and jump to the list page
return redirect('show');
} else {
echo " Login failed ";
}2. Configure the login model .

3. In our laravel Make some configuration changes in the configuration file .
Introduce the model we just set up .

Finally, perform login test
边栏推荐
- Overview of SAP marketing cloud functions (IV)
- Keras deep learning practice (11) -- visual neural network middle layer output
- C language ---18 function (user-defined function)
- How to solve the problem that iterative semi supervised training is difficult to implement in ASR training? RTC dev Meetup
- 作为一名开发者,对你影响最深的书籍是哪一本?
- 常见的单例模式&简单工厂
- ESP32系列--ESP32各个系列对比
- leetcode:1504. Count the number of all 1 sub rectangles
- Py's toad: a detailed introduction to toad, its installation and use
- leetcode:1504. 统计全 1 子矩形的个数
猜你喜欢

Go language - use of goroutine coroutine

MySQL复合索引探究

Unit contour creation method

Qunhui synchronizes with alicloud OSS

数字臧品系统开发 NFT数字臧品系统异常处理源码分享

Bert-whitening 向量降维及使用

Idea connection MySQL custom generated entity class code

MySQL log management, backup and recovery

在宇宙的眼眸下,如何正确地关心东数西算?

In the eyes of the universe, how to correctly care about counting East and West?
随机推荐
【从零开始学zabbix】一丶Zabbix的介绍与部署Zabbix
怎样评价国产报表工具和BI软件
MySQL复合索引探究
[learn ZABBIX from scratch] I. Introduction and deployment of ZABBIX
postgresql之词法分析简介
常见的单例模式&简单工厂
v-for 中 key的作用和原理
[bitbear story collection] June MVP hero story | technology practice collision realm thinking
Go language concurrency model mpg model
leetcode:1504. 统计全 1 子矩形的个数
June training (day 23) - dictionary tree
六月集训(第23天) —— 字典树
MES在流程和离散制造企业的15个差别(下)
Six stones Management: garbage dump effect: if you don't manage your work, you will become a garbage dump
laravel 8 实现Auth登录
数据库一些基本操作(提供了原数据库信息)
Puzzle (016.2) finger painting Galaxy
3环杀掉360安全卫士进程
Research on MySQL composite index
3 ring kill 360 security guard process