momentohq / laravel-cache
Taggable Momento cache driver for Laravel.
Requires
- momentohq/client-sdk-php: v1.7.1
Requires (Dev)
- orchestra/testbench: ^7.11
- dev-main
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.2.1
- v0.2.0
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-chore/ci-build
- dev-latest-readme-template
- dev-release-please--branches--main--components--laravel-cache
- dev-fix/readme-template
- dev-fix/readme-latest-version
- dev-fix/remove-create-cache
- dev-fix/readme
- dev-rishtigupta-patch-1
- dev-fix/update-readme
- dev-feat/async-get-set
- dev-chore/update-api-key
- dev-chore/update-php-sdk
- dev-fix-release-please-version
- dev-add-release-please
- dev-release
- dev-grpc-fork-test
- dev-chore/implement-flush
- dev-fix/generate-readme
- dev-chore/add-tests
- dev-chore/update-php-sdk-version
- dev-fix/remove-commitlint
This package is auto-updated.
Last update: 2024-11-16 21:32:49 UTC
README
Getting Started 🏃
Requirements
- A Momento API Key is required, you can generate one using the Momento Console
- A Momento cache is required, you can generate one using the Momento Console
- At least PHP 8.0
- Composer
- At least Laravel 9.x
- The grpc PHP extension. See the gRPC docs section on installing the extension.
IDE Notes: You'll most likely want to use an IDE that supports PHP development, such as PhpStorm or Microsoft Visual Studio Code.
Examples
Check out full working code in the example app!
Installation
Add our SDK as a dependency to your Laravel installation's composer.json
file:
{ "require": { "momentohq/laravel-cache": "1.1.4" } }
Run composer update
to install the necessary prerequisites.
Then, add MomentoServiceProvider
to your config/app.php
:
'providers' => [ // ... Momento\Cache\MomentoServiceProvider::class ];
And add:
MOMENTO_API_KEY
=<YOUR_API_KEY>MOMENTO_CACHE_NAME
=<CACHE_CREATED_ABOVE>
into your .env
file
Finally, add the required config to your config/cache.php
:
'default' => env('CACHE_DRIVER', 'momento'), 'stores' => [ 'momento' => [ 'driver' => 'momento', 'cache_name' => env('MOMENTO_CACHE_NAME'), 'default_ttl' => 60, ], ],
Run composer update
to install the necessary prerequisites.
Usage
Check out full working code in the example app!
Tuning
Coming soon!
Tag Support
Cache tags work the same way as explained in the Laravel documentation.
Notes: If a tag may contain more than 4MB worth of keys, tagging may not work as intended. Please contact us at support@momentohq.com or on our Discord if you need support for a larger tag set.
Unsupported Cache Operations
The following cache operations are not supported today. If you need these operations, please reach out to us, and we can prioritize the work to complete them. You can file a GitHub issue, e-mail us at support@momentohq.com, or join our Discord.
forever
For more info, visit our website at https://gomomento.com!