configuration

Remove a specific item from the cache.

php artisan php artisan cache:forget

Syntax

Syntax
php artisan cache:forget {key}

Explanation

Removes a single cached item by its key. Useful for targeted cache invalidation without flushing everything. The key must match exactly what was used to store the item.

Example

Example
php artisan cache:forget posts:all

Explanation

Removes a single cached item by its key. Useful for targeted cache invalidation without flushing everything. The key must match exactly what was used to store the item.