Download the PHP package michaeljennings/broker without Composer

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

Broker Build Status Coverage Status

A laravel package that allows you to cache items against an object. For example you may want to cache a user's navigation items against the user model.

Installation

To install through composer simply run the following command:

Or add the following to your composer.json file:

And then run composer install.

For Laravel 5.5 and upwards, the service provider and facade will be loaded automatically. For older versions of Laravel, you will need to add the broker service provider into your providers array in config/app.php.

The package also comes with a facade, to use it add it to your aliases array in config/app.php.

Cacheable Entities

To make a class cacheable you need to implement the Michaeljennings\Broker\Contracts\Cacheable interface and implement the getCacheKey method. This must return a unique key for this class.

Cacheable Models

If you want to make an eloquent model cacheable you can use the Michaeljennings\Broker\Traits\Cacheable trait. This automatically uses the table name as the cache key.

Usage

Broker can be accessed either by its facade, its helper method, or through its IOC binding.

Retrieving Items From Cache

The get method is used to retrieve an item for the cacheable entity. If the item does not exist null will be returned.

Checking If An Item Exists

The has method will check if the key has been set for the cacheable entity.

Retrieve/Store

Occasionally you may want to retrieve an item, but also set the value if it is not set. You can do this using the remember method.

Storing Items In The Cache

The put method will add an item to the cache for the cacheable entity. By default items will be stored for 60 minutes, but you can specify the amount minutes.

Storing Items Forever

The forever method will store items in the cache indefinitely. These items will need to be removed manually with the forget method.

Removing Items From The Cache

The forget method will remove a specific item from the cache.

Or you may remove all of the items for a cacheable entity with the flush method.

Occasionally changes in your application may require you to flush the cache for every entity of a cacheable type, for example you need to clear the cache for every user, but want the rest of the cache to remain.

To this you can use the flushAll method and pass it the class you want to flush.


All versions of broker with dependencies

PHP Build Version
Package Version
Requires illuminate/cache Version >=5.0
illuminate/database Version >=5.0
illuminate/events Version >=5.0
nesbot/carbon Version ^1.0|^2.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 michaeljennings/broker contains the following files

Loading the files please wait ....