PHP 8.3.31
Preview: ForgetCommand.php Size: 1.28 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Cache/Console/ForgetCommand.php

<?php

namespace Illuminate\Cache\Console;

use Illuminate\Cache\CacheManager;
use Illuminate\Console\Command;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(name: 'cache:forget')]
class ForgetCommand extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $signature = 'cache:forget {key : The key to remove} {store? : The store to remove the key from}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Remove an item from the cache';

    /**
     * The cache manager instance.
     *
     * @var \Illuminate\Cache\CacheManager
     */
    protected $cache;

    /**
     * Create a new cache clear command instance.
     *
     * @param  \Illuminate\Cache\CacheManager  $cache
     * @return void
     */
    public function __construct(CacheManager $cache)
    {
        parent::__construct();

        $this->cache = $cache;
    }

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle()
    {
        $this->cache->store($this->argument('store'))->forget(
            $this->argument('key')
        );

        $this->components->info('The ['.$this->argument('key').'] key has been removed from the cache.');
    }
}

Directory Contents

Dirs: 1 × Files: 4

Name Size Perms Modified Actions
stubs DIR
- drwxrwxrwx 2025-09-17 06:52:59
Edit Download
1.01 KB lrw-rw-rw- 2025-09-17 06:52:59
Edit Download
3.36 KB lrw-rw-rw- 2025-09-17 06:52:59
Edit Download
1.28 KB lrw-rw-rw- 2025-09-17 06:52:59
Edit Download
1.42 KB lrw-rw-rw- 2025-09-17 06:52:59
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).