Looking to hire Laravel developers? Try LaraJobs

laravel-cached-options maintained by balping

Description
Cache wrapper around overtrue/laravel-options
Author
Balazs Dura-Kovacs
Last update
2022/03/11 23:43 (dev-master)
License
Links
Downloads
14

Comments
comments powered by Disqus

Laravel Cached Options

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