Table of Contents
- 1) Create status columin users table and also mention in User.php modal
- 2) Add below middleware CheckStatus.php inside app\Http\Middleware
- 3) Add below inside app\Http\Kernel.php
- 4) Put below inside routes files routes/web.php
- 5) You can put below inside login.blade.php file resources\views\auth\login.blade.php
1) Create status columin users table and also mention in User.php modal
Open your phpmyadmin and access the laravel database of your project . Now go to users table and create 'status' column . Data type should 'int' and default value 0 for default registered account considered disabled .2) Add below middleware CheckStatus.php inside app\Http\Middleware
This will check users table column 'status' value. If it won;t found 1 then it logout the user before procedding .3) Add below inside app\Http\Kernel.php
It will register our Middleware class to Kernel.php4) Put below inside routes files routes/web.php
It will override and add middleware to disable login for status 0 user5) You can put below inside login.blade.php file resources\views\auth\login.blade.php
to show message of disabled if account disabled user try to login Well, I have not covered the backend part that handle this status field value update 'active' or 'inactive'.
You can make yourself , it's easy like you make for other field in normal CRUD system .
Finally if you make status field value 0 (means) disabled and try to login the user from frontend then you can't login .
In this way we achieved prevent login the user whose account is disabled. I am a Web Developer working since 2008 ,having experience more than 12 years.
You can contact is, If you looking to hire Laravel Web Developer. 

