Laravel artisan route:cache causes Erroneous data Exception
This worked for me
php artisan optimize:clear
php artisan config:clear
php artisan config:cache
composer dump-autoload
For me, this error was solved by deleting the following path files:
\bootstrap\cache
After a bunch of figuring things out. I found that Apache2 was still using an older version of PHP even though the CLI version was up to date.
After uninstalling all older versions of php and reconfiguring Apache2 to use the latest version fixed this issue.