Download the PHP package slydeath/laravel-nested-caching without Composer

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

Nested Caching for Laravel with caches stack

Latest Stable Version Total Downloads License

Minimum requirements

Installation

Add package to composer.json:

Open config/app.php and add the service provider to the array providers:

To place the configuration file, run:

How to use?

Caching any HTML chunk

To cache any HTML chunk, you just need to pass the caching key to the @cache directive fragment:

Model caching

To enable model caching support, add the trait to it NestedCacheable:

In the template, to cache a model, you need to pass its instance to the @cache directive:

Caching the model for a specified time

To cache the model for a certain time, specify the lifetime in minutes as the second parameter:

Updating the «parent»

For update the cache of the «parent model», we need setup touches:

Usage example:

resources/views/user.blade.php

resources/views/user-car.blade.php

Collection caching

Example of caching a collection:

How to remove stack cache?

Just run this code at bottom of your page:

Workflow with another caches

How to collect keys?

Keys are automatically collected in SlyDeath\NestedCaching\CacheWrittenListener if another-caching is enabled, but you must save them manually (at the end of executing app) if you want to use them elsewhere:

How to clear the stack of another caches?

Just callclearAnotherCaches method:

How to save keys for different pages?

You can generate dynamically the cache key (for example from the page id):

How to clear the stack of another caches with custom cache key?

Just callclearAnotherCaches method and provide the key:

Enable PhpStorm support

Go to the Settings → PHP → Blade, then uncheck Use default settings. Go to Directives tab and press «+» to add another one custom directive:

And add close directive without parameters:


All versions of laravel-nested-caching with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.1
laravel/framework Version ^10.10
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 slydeath/laravel-nested-caching contains the following files

Loading the files please wait ....