{"id":19534661,"url":"https://github.com/hootlex/query-cache","last_synced_at":"2025-04-26T14:35:13.782Z","repository":{"id":29430561,"uuid":"32966461","full_name":"hootlex/query-cache","owner":"hootlex","description":"Easily Cache Eloquent Collections","archived":false,"fork":false,"pushed_at":"2018-06-22T02:07:24.000Z","size":168,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T05:56:59.693Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hootlex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-27T03:48:45.000Z","updated_at":"2018-07-09T22:39:41.000Z","dependencies_parsed_at":"2022-08-25T04:51:01.133Z","dependency_job_id":null,"html_url":"https://github.com/hootlex/query-cache","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootlex%2Fquery-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootlex%2Fquery-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootlex%2Fquery-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hootlex%2Fquery-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hootlex","download_url":"https://codeload.github.com/hootlex/query-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251001353,"owners_count":21520934,"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-11T02:15:06.084Z","updated_at":"2025-04-26T14:35:13.499Z","avatar_url":"https://github.com/hootlex.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **IMPORTANT NOTICE: This package is not maintained and maybe not working at all. Use it at your own risk!!**\n\n# Laravel 5 query cache\n\nThis Laravel 5 package allows you to easily cache eloquent queries by implementing laravel 4 remember method.\n\n##How to use\n###Step 1: Install Through Composer\n```\ncomposer require kyrenator/query-cache\n```\n###Step 2: Use QueryCache In Your Model\n```php\n\u003c?php namespace App;\n\nuse Kyrenator\\QueryCache\\QueryCache;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Post extends Model {\n    use QueryCache;\n}\n```\n###Step 3: Use remember Method When Quering Eloquent\nWhen calling remember method you can tell it for how many minutes you want the query be cached.\nIf you dont specify the minutes, the query will be cached for 60 minutes.\n```php\n\\App\\Post::remember()-\u003etake(3)-\u003eget();\n\n//use cache tags\n\\App\\Post::remember()-\u003ecacheTags('posts', 'fresh')-\u003etake(3)-\u003eget();\n```\n\n##More Features\n###Global Cache\nIf you want you can cache all queries for a specific model by siply defining cacheAll var inside your model.\nQueryCache will aply remember method to all model queries.\n```php\n\u003c?php namespace App;\n\nuse Kyrenator\\QueryCache\\QueryCache;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Post extends Model {\n    use QueryCache;\n    protected $cacheAll = true;\n}\n```\n###Clear Cache On Change\nIf you want the cache to be flushed when you create, delete, or update an existing model then define $clearOnChange\n```php\n\u003c?php namespace App;\n\nuse Kyrenator\\QueryCache\\QueryCache;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Post extends Model {\n    use QueryCache;\n    protected $clearOnChange = true;\n}\n``` \n###Cache Tags\nQueryCache will use the model name as cache tags. You can also define custon cache tags.\n```php\n\u003c?php namespace App;\n\nuse Kyrenator\\QueryCache\\QueryCache;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Post extends Model {\n    use QueryCache;\n    protected $clearOnChange = true;\n    protected $cacheTags = 'fresh';\n    protected $cacheAll = true;\n}\n``` \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhootlex%2Fquery-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhootlex%2Fquery-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhootlex%2Fquery-cache/lists"}