Laravel KV Store
Fully managed, Redis® OSS API compatible key-value store and cache
Powered by Upstash
Introduction
Laravel Cloud allows you to create Redis-compatible key-value stores and attach them to your application’s environments directly from the Laravel Cloud dashboard.
Laravel KV stores may be used as your Laravel application’s cache or queued jobs storage backend. Or, you may interact directly with the key-value store using the Redis API.
Creating a KV Store
To attach a Laravel KV store to an environment, click “Add cache” on your environment’s infrastructure canvas dashboard. When adding a cache to an environment, Laravel Cloud will prompt you to select the cache you would like to attach to the environment or to create a new cache. When creating a new cache, select “Laravel KV Store” as your cache type.
Once the cache has been attached to an environment, you will need to re-deploy the environment in order for the changes to take effect.
Visit the pricing docs for information on sizes, prices, and limits on max connections, data transfer, and command throughput.
Connecting to KV Stores
From Your Application
When a cache is attached to an environment, Laravel Cloud will automatically inject the environment variables needed by the Laravel application to interact with the cache via the Cache
facade, including the CACHE_STORE
, REDIS_HOST
, and REDIS_PASSWORD
variables. You may view these environment variables in your environment’s General Settings.
From Your Local Machine
To connect to your Redis-compatible KV store from your local machine using a database management client like TablePlus, click the ”…” icon next to the database card in your environment’s infrastructure canvas dashboard, then click “View credentials”.
The cache credentials modal window will provide you with the credentials needed to connect to your cache, in addition to a “DeepLink” which will open your database in your local machine’s default Redis-compatible database management client if you have one installed.
Editing and Resizing KV Stores
You may edit and resize a Laravel KV store via your organization’s “Resources” page. From the “Resources” page, navigate to the “Caches” tab and click the ”…” icon for the KV store you would like to edit or resize. Then, click “Edit settings”.
KV Store Metrics
You may view metrics such as throughput and hit / miss ratio for Laravel KV stores via your organization’s “Resources” page. From the “Resources” page, navigate to the “Caches” tab and click the ”…” icon for an available KV store. Then, click “View metrics”.
Deleting KV Stores
You may delete a Laravel KV store via your organization’s “Resources” page. From the “Resources” page, navigate to the “Caches” tab and click the ”…” icon for the KV store you would like to delete. Then, click “Delete cache”.
Was this page helpful?