没有足够的参数(缺少:“密钥”)。在laravel php工匠缓存中:忘了

问题描述 投票:0回答:3

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

php artisan cache:忘了

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

php laravel laravel-cache
3个回答
2
投票

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

这是list参数和cache的选项:forget命令laravel 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

0
投票

您可以使用

php artisan cache:clear

使用此命令生成密钥后:

php artisan key:generate

0
投票

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

你也可以使用artisan console

php artisan cache:forget key="yourkey"

希望这可以帮助

© www.soinside.com 2019 - 2024. All rights reserved.