balping/laravel-cached-options

Cache wrapper around overtrue/laravel-options

v0.0.1 2022-03-11 21:14 UTC

This package is auto-updated.

Last update: 2024-11-12 03:30:19 UTC


README

Simple wrapper around overtrue/laravel-options global options module for Laravel application to provide basic caching functionality.

Installation

First disable auto-discovery for overtrue/laravel-options:

In composer.json add:

   "extra": {
        "laravel": {
            "dont-discover": [
	            "overtrue/laravel-options"
            ]
        }
    }

Then install the package via composer:

composer require balping/laravel-cached-options

Publish configuration and migrations

$ php artisan vendor:publish --provider="Balping\LaravelCachedOptions\CachedOptionsServiceProvider"

Run migrations

$ php artisan migrate

Configuration

In config/cache.php configure a driver that supports tags. Warning! File, dynamodb, or database drivers are not supported.

In config/options.php you can choose a TTL for cached values. TTL of null means forever.

Usage

Exactly the same way as described in overtrue/laravel-options documentation, but all the values are going to be cached.

License

MIT