Skip to content
Advertisement

Laravel 5 – How to check username & password is match with table?

I have created the below login form in Laravel 5 and I want to simply check if the username & password matches with that of the database table and if so, redirect to the dashboard page else stay on the login page. I am also trying to find the solution by myself but I am posting this question to get an idea of how to do these things in Laravel 5.

Any idea??

2015_09_10_050324_admin_details.php (migrations)

JavaScript

Database structure

enter image description here

enter image description here

login.blade.php (view)

JavaScript

AdminLoginController.php (controller)

JavaScript

AdminLoginModel.php (model)

JavaScript

routes.php

JavaScript

Advertisement

Answer

try like this

login.blade.php

JavaScript

Model:-

JavaScript

Controller:-

JavaScript

route:-

JavaScript

migration:-

JavaScript

let me know if there any errors.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement