1

当我尝试从 laravel 5.5 项目中删除我的所有缓存文件时,我在运行此命令时遇到了一些错误

php工匠缓存:忘记

没有足够的参数(缺少:“key”)。

4

3 回答 3

2

使用命令php artisan cache:forget -h查看列表参数和选项。

这是缓存的列表参数和选项:忘记命令 larvel 5.4

Arguments:
  key                   The key to remove
  store                 The store to remove the key from

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

如果要删除所有缓存文件,可以运行此命令

php artisan cache:clear
php artisan config:cache

并查看更多工匠命令

php artisan list
于 2018-03-05T06:02:40.527 回答
0

要删除整个缓存,您可以使用Cache::flush(); 对于从缓存中删除密钥,您可以以Cache::forget('key')编程方式使用。

你也可以使用artisan console

php artisan cache:forget key="yourkey"

希望这可以帮助

于 2018-03-05T07:17:55.600 回答
0

您可以使用

php artisan cache:clear

使用此命令生成密钥后:

php artisan key:generate
于 2018-03-05T06:06:43.700 回答