Last active
March 20, 2021 10:00
-
-
Save mdmuzammalhoq/fc18bc8218d4e9bbf1fcf15545f230e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$table->boolean('approved')->default('0')->nullable() ======= // in user table | |
// approval middleware | |
public function handle($request, Closure $next){ | |
if(auth()->check()) | |
{ | |
if(!auth()->user()->approved){ | |
auth()->logout(); | |
return redirect()->route('login')->with('message', transl('Your account need adminnistration approval')); | |
} | |
} | |
return $next($request); | |
} | |
//Kernel File | |
Add Approvalmiddleware class =========== as default system. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.youtube.com/watch?v=PREOLFhmqBw