Download the PHP package vatvit/freshen-laravel without Composer

On this page you can find all versions of the php package vatvit/freshen-laravel. 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 freshen-laravel

⚠️ Read-only mirror. This repository is the Packagist publish mirror of packages/laravel in the Freshen monorepo. Source, issues, and pull requests live there — please don't open them here. Install with composer require vatvit/freshen-laravel.


Freshen — Laravel bridge

Drop-in stale-while-revalidate caching for Laravel. composer require, publish one config, and resolve caches by name through the Freshen facade — with cache-stampede prevention and queued async invalidation.

Packagist Version PHP Version License

The Laravel bridge for Freshen brings the caching pieces you normally wire up by hand into a service provider + facade: single-flight recompute so exactly one worker rebuilds a hot key while everyone else is served the last good value (no cache-stampede); preemptive refresh that recomputes an entry before it goes stale, on TTLs and jitter you control; structured keys and effective delete — genuinely evict one exact key or a whole prefix, atomically and in one round-trip; and built-in metrics on every hit, miss, and rebuild. Define a cache per dataset in config/freshen.php, reach it with Freshen::cache('...') (async invalidation on the queue), and every cache-related decision is explicit and yours.

Features

Laravel integration

Powered by Freshen core

Full detail in the core README.

At a glance

composer require, define a cache in config/freshen.php, then reach it by name through the Freshen facade — reading is two lines, and you never touch the store, a stampede, or serialisation:

On a miss the cache calls your loader, stores the result, and returns it; later reads are served stale-while-revalidate with stampede protection — all automatic.

Install

The FreshenServiceProvider is auto-discovered (package discovery). Publish the config:

Configure

A Freshen cache is one dataset — its own loader + TTLs — so a real app defines one cache per data structure (top sellers, prices, categories, …). You declare each under caches in config/freshen.php, keyed by the name you'll resolve it with. Each references a loader (yours, implementing Freshen\Interface\LoaderInterface) resolved from the container, and a Laravel redis connection name whose phpredis client Freshen reuses.

Freshen reuses the phpredis client from config/database.php's redis.<connection> — no second connection is opened. Use the phpredis client ('client' => 'phpredis').

Use

Resolve a cache by name with the Freshen facade — there is no "default" cache, since each one is a distinct dataset:

Prefer constructor injection? Inject the manager and pick the dataset:

(You inject FreshenManager (or use the Freshen facade), never a bare Freshen\Cache: with several datasets Laravel can't autowire Freshen\Cache by type, so it isn't bound — you always ask for a cache by name.)

Async invalidation (queue)

Laravel's event dispatcher is not PSR-14, so the bridge ships a small PSR-14 adapter that pushes async operations onto Laravel's queue. invalidate() / invalidateExact() / refresh() (async by default) dispatch a ProcessFreshenAsyncEvent job that runs the cache's Freshen\AsyncHandler on a worker — off the request.

Need a specific call to run inline (no worker)? Pass SyncMode::SYNC:

Each job carries its target cache name, so async invalidation is routed to exactly the right cache (no cross-cache fan-out).

Security

Tracked by the Packagist security advisory database — run composer audit to check your install. Report vulnerabilities privately via GitHub Security Advisories; the full policy is in SECURITY.md.

Versioning

Independent SemVer, released as laravel-vX.Y.Z. Depends on vatvit/freshen-php via ^1.0. A core patch/minor needs no bridge release; a core major does. See the monorepo RELEASING.md.

Requires PHP 8.2+ and Laravel 11 or 12. (Laravel 10 — the only 8.1-compatible line — is EOL and flagged by composer security advisories, so it is not supported.)

Links


All versions of freshen-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
vatvit/freshen-php Version ^1.0
psr/event-dispatcher Version ^1.0
illuminate/support Version ^11.0 || ^12.0
illuminate/contracts 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 vatvit/freshen-laravel contains the following files

Loading the files please wait ...