Skip to content

Instantly share code, notes, and snippets.

@mdmuzammalhoq
Last active March 20, 2021 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdmuzammalhoq/fc18bc8218d4e9bbf1fcf15545f230e8 to your computer and use it in GitHub Desktop.
Save mdmuzammalhoq/fc18bc8218d4e9bbf1fcf15545f230e8 to your computer and use it in GitHub Desktop.
$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.
@mdmuzammalhoq
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment