Even after restarting Apache, sometimes has internal chaches that don’t reflect the updated program.
php artisan cache: clear php artisan config: clear php artisan route: clear php artisan view clear
If you want to do autoloading and re-optimize, you want to recreate the cache entirely.
composer dump-autoload php artisan clear-compiled php artisan optimize php artisan config:cache
When recreating a new key and completely invalidate the previous cache.
php artisan key:generate