Although project work fine in local, when deploy on server found error. laravel 7 php version 7.4.13
ParseError: syntax error, unexpected 'Parser' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in file /var/www/html/laravel/vendor/lcobucci/jwt/src/Configuration.php on line 22
public function verifyOtp(Request $request)
{
$phoneno = $request->input('loginId');
$enteredOtp = $request->input('password');
$loginData = [
'login_id' => $phoneno,
'password' => $enteredOtp
];
// dd($loginData);
if (!auth()->attempt($loginData)) {
return response([
'message' => 'OTP incorrect!',
'status'=>0
]);
} else {
// dd("Here");
$accessToken = auth()->user()->createToken('authToken')->accessToken;
return response([
'user' =>auth()->user(),
'access_token' =>$accessToken,
'message'=>"Successfully login",
'status'=>1
]);
}
}
You would need PHP 7.4+ to use the code base you currently have. The version of the package that the error is coming from uses features from PHP 7.4.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.