问题
I know this question has already been asked. But none of them solve my issue.
I am facing the issue : DecryptException in BaseEncrypter.php line 48: The MAC is invalid.
I checked my .env file there is no space in APP_DEBUG and APP_KEY
Tried to generate new key but nothing worked out.
Laravel Framework version 5.2.45
回答1:
After surfing for around two hours , tried so many solution form different sources but none of them solved my problem.
There may be reason then .env file have space in APP_DEBUG and APP_KEY key.
By removing the space if exists can solve the problem.
By clearing cache, composer dump-autoload can also be used in some cases.
But in my case the issue was either
DecryptException in BaseEncrypter.php line 48: The MAC is invalid
or
DecryptException in BaseEncrypter.php line 45: The payload is invalid
The issue was because of database column issue.
The column type was
varcharand length was256that was creating whole issues. As fieldmwsAuthTokenhas lenght more then filed256and was truncating themwsAuthTokenkey value.Thus by changing the field type to text solved my problem.
来源:https://stackoverflow.com/questions/49788839/decryptexception-in-baseencrypter-php-line-48-the-mac-is-invalid-laravel-5-2