Skip to main content

Laravel FAQ

Missing app key

No application encryption key has been specified

php artisan key:generate

php artisan config:cache

429: Too Many Requests

  • ThrottleRequests

Class 'Monolog\Logger' not found

  • 注意前置错误
stat vendor/monolog/monolog/src/Monolog/Logger.php
cat vendor/composer/autoload_static.php | grep -E 'Monolog[\\]+Logger' # 确保存在

Declaration of Monolog\Logger::emergency

Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with PsrExt\Log\LoggerInterface::emergency($message, array $context = [])

laravel

APP_ENV=local
APP_DEBUG=true
php artisan env

php artisan view:clear
php artisan cache:clear