当前位置:网站首页>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
边栏推荐
- v-if 和 v-show 的区别
- 简谈企业Power BI CI /CD 实施框架
- Puzzle (016.2) finger painting Galaxy
- Digital business cloud: strengthen supplier management and promote efficient collaboration between air transport enterprises and suppliers
- How to avoid placing duplicate orders
- IList of PostgreSQL
- 不要小看了积分商城,它的作用可以很大
- SSH keygen configuration does not require entering a password every time
- 数字臧品系统开发 NFT数字臧品系统异常处理源码分享
- STM32F1与STM32CubeIDE编程实例-WS2812B全彩LED驱动(基于SPI+DMA)
猜你喜欢

Bert-whitening 向量降维及使用

【无标题】

Digital business cloud: strengthen supplier management and promote efficient collaboration between air transport enterprises and suppliers

Explore cloud native databases and take a broad view of future technological development

`Thymeleaf`模板引擎全面解析

Kunpeng arm server compilation and installation paddlepaddle

P2PDB 白皮书

ASCII code table extracted from tanhaoqiang's C program design (comparison table of common characters and ASCII codes)

Development of digital Tibetan product system NFT digital Tibetan product system exception handling source code sharing

The "little giant" specialized in special new products is restarted, and the "enterprise cloud" digital empowerment
随机推荐
食品饮料行业渠道商管理系统解决方案:实现渠道数字化营销布局
Brief discussion on the implementation framework of enterprise power Bi CI /cd
laravel 8 实现Auth登录
作为一名开发者,对你影响最深的书籍是哪一本?
puzzle(016.2)指画星河
How to evaluate domestic reporting tools and Bi software
六月集训(第23天) —— 字典树
Halcon draw area into picture
Unity 热力图建立方法
第八章 操作位和位串(四)
R language plot visualization: use plot to visualize the training set and test set after data division, use different shape label representation, training set, test set, and display training and test
The function and principle of key in V-for
Py's toad: a detailed introduction to toad, its installation and use
[pytoch] quantification
六石管理学:垃圾场效应:工作不管理,就会变成垃圾场
六月集训(第24天) —— 线段树
在宇宙的眼眸下,如何正确地关心东数西算?
How to implement redis cache of highly paid programmers & interview questions series 115? How do I find a hot key? What are the possible problems with caching?
如何解决 Iterative 半监督训练 在 ASR 训练中难以落地的问题丨RTC Dev Meetup
高薪程序员&面试题精讲系列115之Redis缓存如何实现?怎么发现热key?缓存时可能存在哪些问题?