创建数据库表时,不是自己读取.env 文件的是通过config/database.php
来读取.env 常量值。
设置好不生效常量清理命令:
php artisan key:generate
php artisan jwt:secret
php artisan route:clear
php artisan config:clear
php artisan cache:clear
php artisan config:cache
在每次更改.env和config目录下的文件,需要执行命令:
php artisan config:cache
在常规代码里用env(),不起作用,获取不到.env的值
在.env里定义了常量,需要在config目录下的配置里去定义