PHPackages                             ali-raza/file-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. ali-raza/file-cache

ActiveLibrary[Caching](/categories/caching)

ali-raza/file-cache
===================

A file cache package for Laravel.

09PHP

Since Oct 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AliRazakhan5/file-cache)[ Packagist](https://packagist.org/packages/ali-raza/file-cache)[ RSS](/packages/ali-raza-file-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[File Cache](https://github.com/AliRazakhan5/file-cache)
========================================================

[](#file-cache)

[![Build Status](https://camo.githubusercontent.com/c59043e0b28eab034f19dabc49c9222c43e3fbe5e0c6bc2837a5c0086132a211/68747470733a2f2f7472617669732d63692e6f72672f6c61726176656c2f6672616d65776f726b2e737667)](https://github.com/AliRazakhan5/file-cache)[![Latest Stable Version](https://camo.githubusercontent.com/9e6071b5dd1a4a3bcabe3cca9d97a447d030caeb940f2adbd18699bc0b326702/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2f6672616d65776f726b)](https://github.com/AliRazakhan5/file-cache)[![License](https://camo.githubusercontent.com/4a64c31c71966d152c876eea1f35e85fbd33d57ddf5754260a41f053aa72c5b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c61726176656c2f6672616d65776f726b)](https://github.com/AliRazakhan5/file-cache)

About Package
-------------

[](#about-package)

FileCache is a lightweight, custom file-based caching solution designed for Laravel. It provides an easy and efficient way to cache data on the filesystem, bypassing the need for more complex cache stores like Redis or Memcached. The package is especially useful for smaller applications or environments where disk-based caching is preferred.

Features
--------

[](#features)

File-Based Caching: Store cache data in the filesystem without relying on external cache servers.

Expiration Support: Set cache expiration times, and automatically remove stale cache entries.

Flexible Cache Management: Easily get, put, forget, and flush cache data with intuitive methods.

Cache Increments &amp; Decrements: Support for numeric cache manipulation.

Forever Caching: Ability to store items indefinitely until explicitly removed.

Simple Integration: Works seamlessly with any Laravel application with minimal setup.

Installation
------------

[](#installation)

To install the package via Composer, run the following command:

composer require ali-raza/file-cache

Publishing Configuration
------------------------

[](#publishing-configuration)

After installing the package, publish the configuration file using the following Artisan command:

php artisan vendor:publish --provider="AliRaza\\FileCache\\Providers\\FileCacheServiceProvider"

This will publish a configuration file at config/filecache.php, allowing you to customize the cache directory. Ensure that the service provider is registered automatically. If not, manually add it to the providers array in config/app.php:

// package Service Providers

'providers' =&gt; \[AliRaza\\FileCache\\Providers\\FileCacheServiceProvider::class,\],

Basic Usage
-----------

[](#basic-usage)

Here’s an example of how to use FileCache in your Laravel project:

use AliRaza\\FileCache\\FileCache;

// Create an instance of FileCache

$cache = new FileCache();

// Put an item in the cache

$cache-&gt;put('key', 'value', 3600); // Cache for 1 hour

// Get an item from the cache

$value = $cache-&gt;get('key');

// Remove an item from the cache

$cache-&gt;forget('key');

// Clear all cached items

$cache-&gt;flush();

Configuration
-------------

[](#configuration)

The package allows you to configure the directory where cache files will be stored by editing config/filecache.php:

return \['cache\_directory' =&gt; storage\_path('framework/cache/filecache'),\];

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within Laravel, please send an e-mail to Ali Raza Khan via [araza@polymerhq.io](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.

License
-------

[](#license)

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 68.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1dcbf87a4060924be56c9fd5475d8ef92472d326379aca9db050f798345f72e?d=identicon)[Ali Raza Khan](/maintainers/Ali%20Raza%20Khan)

---

Top Contributors

[![testfgrr](https://avatars.githubusercontent.com/u/7902564?v=4)](https://github.com/testfgrr "testfgrr (11 commits)")[![AliRazakhan5](https://avatars.githubusercontent.com/u/178162750?v=4)](https://github.com/AliRazakhan5 "AliRazakhan5 (5 commits)")

### Embed Badge

![Health badge](/badges/ali-raza-file-cache/health.svg)

```
[![Health](https://phpackages.com/badges/ali-raza-file-cache/health.svg)](https://phpackages.com/packages/ali-raza-file-cache)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
