Download the PHP package suitmedia/laravel-cacheable without Composer

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

Build codecov Total Downloads Latest Stable Version License: MIT

Laravel Cacheable

Decorate your repositories and make them cacheable

Synopsis

This package will help you to make your repositories cacheable without worrying about how to manage the cache, and provide an easy way to invalidate the cache. Laravel Cacheable package uses a dynamic decorator class to wrap your existing repository and add the auto-caching feature into it.

Table of contents

Compatibility

Laravel version Cacheable version
5.1.x - 5.4.x 1.0.x - 1.3.x
5.5.x - 5.8.x 1.4.x
6.x 1.5.x
7.x 1.6.x
8.x 1.7.x
9.x 1.9.x - 1.10.x
10.x 1.11.x
11.x 1.12.x

Requirements

This package require you to use cache storage which supports tags like memcached or redis. You will get errors if you use this package while using any cache storage which does not support tags.

Setup

Install the package via Composer :

If you are using Laravel version 5.5+ then you can skip registering the service provider and package alias in your application.

Register The Service Provider

Add the package service provider in your config/app.php

Register The Package Alias

Add the package alias in your config/app.php

Configuration

Publish configuration file using php artisan command

The command above would copy a new configuration file to /config/cacheable.php

Usage

Prepare Your Model

Every Model that you wish to be cached should implement the CacheableModel contract and use the CacheableTrait. The trait will add extra features to your model and observe your model for any future changes. This way, the package will notice whenever the observed model get updated and then it will flush the cache related to the affected model immediately.

Prepare Your Repository

Every Repository that you need to be cached also have to implements the CacheableRepository contract. You can implements the contract simply by using the CacheableTrait like this :

Retrieve Data From Repository And Cache The Result

With this package, you won't need to create new classes to decorate each of your repositories. You can just decorate them using the Cacheable facade, and all results of the repository's methods will be cached automatically.

Cache Invalidation

This package will help you to invalidate the cache automatically whenever the CacheableModel is updated. It will invalidate the cache based on the cache tags which have been defined in your model.

But, you can also invalidate the cache manually using the Cacheable facade.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-cacheable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/cache Version ^8.0|^9.0|^10.0|^11.0
illuminate/database Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.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 suitmedia/laravel-cacheable contains the following files

Loading the files please wait ....