Download the PHP package momentohq/laravel-example without Composer

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

logo

Momento Laravel Example

In this repo, you will see an example of how to integrate a Momento cache into your Laravel app, instead of a Redis or Memcached. What's the benefits, you ask? You don't have to worry about Redis/Memcached nodes! Intrigued? Keep on reading!

Run the app via Docker

Before building a Docker image, create .env file in docker directory with the following env variables:

If you don't have a Momento API key, you can generate one using the Momento Console.

Build a Docker image for the app:

Note: Building the laravel-example image involves compiling the PHP gRPC extension, which will take several minutes to complete.

If you run into the API limits from GitHub, add a GitHub personal access token to your composer configuration:

And run a Docker container with the image:

Manual PHP Setup

You will need to install the following:

Add the repository and dependency to your project's composer.json:

Add the Momento configuration to the 'stores' section of config/cache.php, adjusting the cache_name and default_ttl parameters as needed:

Update the cache driver entry in your .env file:

CACHE_DRIVER=momento

And add the following environment variables into your .env file:

If you don't have a Momento API key, you can generate one using the Momento Console.

Run composer update to install the necessary prerequisites.

To run this application:

cURL commands

or

or

Exploring the Momento Cache Integration

Examples of different ways to use Momento's Laravel cache client and cache driver can be found in the WeatherController.php.

For examples of using the Momento client directly, check out our PHP SDK examples!

A simple example usage of Momento's Laravel cache driver is extracted below:


All versions of laravel-example with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.2
guzzlehttp/guzzle Version ^7.5
momentohq/laravel-cache Version v1.0.5
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 momentohq/laravel-example contains the following files

Loading the files please wait ....