Posts

Showing posts with the label laravel 5

laravel localhost xamp SQLSTATE[42000]: Syntax error or access violation: 1055 'saveapp.marketing_ad.id' isn't in GROUP BY

Error: laravel localhost xamp SQLSTATE[42000]: Syntax error or access violation: 1055 'your groupby field' isn't in GROUP BY     In   config/database.php Change   'strict' => true   To   'strict' => false   and clear the cache php artisan config:cache above command plays the main role to solving this error OR In MySql settings change mysql > SET GLOBAL sql_mode =( SELECT REPLACE (@ @sql_mode , 'ONLY_FULL_GROUP_BY' , '' ));

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