{"id":19684818,"url":"https://github.com/orumad/lumen-config-cache","last_synced_at":"2025-04-29T06:30:35.775Z","repository":{"id":23151812,"uuid":"98287934","full_name":"orumad/lumen-config-cache","owner":"orumad","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-24T10:57:06.000Z","size":11,"stargazers_count":10,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-15T22:42:33.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orumad.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-25T09:16:06.000Z","updated_at":"2022-12-12T15:57:37.000Z","dependencies_parsed_at":"2022-07-27T03:47:20.380Z","dependency_job_id":null,"html_url":"https://github.com/orumad/lumen-config-cache","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orumad%2Flumen-config-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orumad%2Flumen-config-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orumad%2Flumen-config-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orumad%2Flumen-config-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orumad","download_url":"https://codeload.github.com/orumad/lumen-config-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224151534,"owners_count":17264523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T18:19:03.618Z","updated_at":"2024-11-11T18:19:04.147Z","avatar_url":"https://github.com/orumad.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lumen-config-cache\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/orumad/lumen-config-cache.svg?style=flat-square)](https://packagist.org/packages/orumad/lumen-config-cache) [![Total Downloads](https://img.shields.io/packagist/dt/orumad/lumen-config-cache.svg?style=flat-square)](https://packagist.org/packages/orumad/lumen-config-cache) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square)](https://packagist.org/packages/orumad/lumen-config-cache)\n\nAdds the Laravel artisan command `config:cache` to Lumen.\n\nOnce installed you can type `php artisan lumen-config:cache` in your console to gets all your Lumen configuration files loaded in the cache, which will increase your Lumen app response times. \n\n\n## Installation\n\nThis package can be used in Laravel 5.4 or higher with PHP 7.0 or higher.\n\nYou can install the package via composer:\n\n```bash\ncomposer require orumad/lumen-config-cache\n```\n\nNow register the service provider in `bootstrap/app.php` file:\n\n```php\n$app-\u003eregister(Orumad\\ConfigCache\\ServiceProviders\\ConfigCacheServiceProvider::class);\n```\n\nIf you want to publish automatically the config file, you must install a package like [lumen-vendor-publish](https://github.com/laravelista/lumen-vendor-publish), which contains a single command that enables you to publish a package config file to the config folder of your Lumen application.\n\nSo you can publish the config file like in Laravel:\n\n```bash\nphp artisan vendor:publish --tag=\"lumen-config-cache\"\n```\n\nIf you dedice to not install any aditional package, then you can copy the file `vendor/orumad/lumen-config-cache/src/config/config-cache.php` to your app `config` folder.\n\n\nThis is the contents of the published `config/config-cache.php` config file:\n\n```php\nreturn [\n\n    /**\n     * The name of the key where the config is stored in cache\n     */\n    'cache_key' =\u003e 'config_cache',\n\n    /**\n     * Expiration time for the config in cache\n     */\n    'cache_expiration_time' =\u003e 60*24, // One day\n\n    /**\n     * The config files (app, database, queue, etc.) to be cached\n     * Add to this array whatever config files you want to load in cache\n     */\n    'config_files' =\u003e [\n        'app',\n    ],\n\n];\n```\n\n\nYou should enable the use of facades in Lumen uncommenting the following line in your `bootstrap/app.php` file:\n\n``` php\n// $app-\u003ewithFacades();\n```\n\n\n\n## Usage\n\nYou can access your config keys with `ConfigCache::get` facade method:\n\n``` php\n\nuse Orumad\\ConfigCache\\Facades\\ConfigCache;\n\n...\n\n$api_url = ConfigCache::get('app.API_URL');\n\n```\n\n\nAlso you can force the cached config to be refreshed with `ConfigCache::refresh` facade method:\n\n``` php\n\nuse Orumad\\ConfigCache\\Facades\\ConfigCache;\n\n...\n\nConfigCache::refresh();\n\n```\n\n\nYou can use the `artisan` command `lumen-config:cache` to force the cached configuration to be refreshed too.\n\n\n**TIP: Add this command to your deployment script to be sure you have the last config cached after deploy your new app release:**\n\n``` bash\nphp artisan lumen-config:cache\n```\n\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n\n## Security\n\nIf you discover any security related issues, please email dev@danielmunoz.io instead of using the issue tracker.\n\n\n## Credits\n\n- [Daniel Muñoz](https://twitter.com/daniel_munoz_)\n- [All contributors](../../contributors)\n\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forumad%2Flumen-config-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forumad%2Flumen-config-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forumad%2Flumen-config-cache/lists"}