Download the PHP package philiprehberger/laravel-cache-toolkit without Composer

On this page you can find all versions of the php package philiprehberger/laravel-cache-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-cache-toolkit

Laravel Cache Toolkit

Tests Latest Version on Packagist Last updated

Standardized cache key builder and tag-aware cache operations for Laravel with graceful fallback for non-tagging drivers.

Requirements

Installation

The service provider is auto-discovered by Laravel. Optionally publish the config file:

This places config/cache-toolkit.php into your application.

Usage

CacheKeyBuilder

CacheKeyBuilder is a static utility class for building consistent, predictable cache keys.

CacheTagManager

CacheTagManager wraps Laravel's Cache facade with tag-aware operations. When the driver does not support tags (file, array, database) all operations fall back transparently to plain cache calls.

Configuration

API

CacheKeyBuilder

Method Description Returns
CacheKeyBuilder::make(string ...$parts) Build a key from arbitrary parts (empty parts filtered) string
CacheKeyBuilder::forModel(Model $model, string ...$suffix) Build a key from a model instance string
CacheKeyBuilder::forModelType(string $class, int\|string $id, string ...$suffix) Build a key from a class name and ID string
CacheKeyBuilder::forList(string $type, array $filters = []) Build a list key with optional filter hash string
CacheKeyBuilder::forPaginated(string $type, int $page, int $perPage, array $filters = []) Build a paginated list key string
CacheKeyBuilder::forAnalytics(string $type, ?string $from = null, ?string $to = null) Build an analytics key string
CacheKeyBuilder::forUser(int $userId, string $type) Build a user-scoped key string
CacheKeyBuilder::forDateRange(string $type, string $from, string $to) Build a date-range key string
CacheKeyBuilder::ttl(string $key) Get TTL in seconds from config int
CacheKeyBuilder::ttlCarbon(string $key) Get TTL as Carbon instance DateTimeInterface
CacheKeyBuilder::tags(string $type) Get tag array from config string[]
CacheKeyBuilder::supportsTags() Check if current driver supports tags bool

CacheTagManager

Method Description Returns
->remember(string $ttlKey, callable $callback, array $tags, string ...$keyParts) Get or store a value mixed
->put(string $key, mixed $value, int $ttl, array $tags = []) Store a value void
->get(string $key, array $tags = []) Retrieve a value mixed
->has(string $key, array $tags = []) Check existence bool
->forget(string $key, array $tags = []) Remove a value void
->flush(array $tags) Flush all entries for given tags bool
->flushType(string $type) Flush entries for a config-defined type bool
->flushTypes(string[] $types) Flush multiple config-defined types bool[]

Tag Driver Support

Driver Tags Supported Behaviour
redis Yes Tags used for grouping and invalidation
memcached Yes Tags used for grouping and invalidation
file No Falls back to plain cache; flush returns false
array No Falls back to plain cache; flush returns false
database No Falls back to plain cache; flush returns false

Development

Support

If you find this project useful:

Star the repo

🐛 Report issues

💡 Suggest features

❤️ Sponsor development

🌐 All Open Source Projects

💻 GitHub Profile

🔗 LinkedIn Profile

License

MIT


All versions of laravel-cache-toolkit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/cache Version ^11.0|^12.0
illuminate/config Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package philiprehberger/laravel-cache-toolkit contains the following files

Loading the files please wait ...