Posts

Showing posts from August, 2020

the token could not be parsed from the request jwt error in laravel

Tymon \ JWTAuth \ Exceptions \ JWTException The token could not be parsed from the request  Add this line to your .htaccess file RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

How to add extra condition while login user form in laravel?

How to add extra condition in login form in laravel  First open these folder Yoursite|vendor\laravel\framework\src\Illuminate\Foundation\Auth then find public function login(Request $request) this funcation add these line at the top of funcation  $user = User::where('email',$request->email)->first(); if($user && $user->role!=1){       return redirect()->back()->with('error','You are not an admin.'); } $user->role or any other condition which you want to check then go to view where you will show this error Copy and paste this code  @if($message = Session::get('error'))                         <div class="errorlv">                             <i class="zmdi zmdi-alert-circle"></i> {{ $message }}                         </div>                         @endif