{"id":41150484,"url":"https://github.com/dbfx/laravel-strapi","last_synced_at":"2026-01-22T19:05:19.576Z","repository":{"id":42972380,"uuid":"362016455","full_name":"dbfx/laravel-strapi","owner":"dbfx","description":"Laravel wrapper for using the Strapi headless CMS","archived":false,"fork":false,"pushed_at":"2025-04-20T04:48:25.000Z","size":89,"stargazers_count":48,"open_issues_count":7,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-02T13:32:46.143Z","etag":null,"topics":["hacktoberfest","laravel","laravel-package","strapi","strapi-cms"],"latest_commit_sha":null,"homepage":"https://blakey.co","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/dbfx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"dbfx"}},"created_at":"2021-04-27T07:14:32.000Z","updated_at":"2025-05-06T10:54:36.000Z","dependencies_parsed_at":"2025-04-20T05:33:47.993Z","dependency_job_id":null,"html_url":"https://github.com/dbfx/laravel-strapi","commit_stats":{"total_commits":58,"total_committers":10,"mean_commits":5.8,"dds":0.3448275862068966,"last_synced_commit":"bddac5e3c50c08bf4819964eb403fee922488ee2"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/dbfx/laravel-strapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfx%2Flaravel-strapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfx%2Flaravel-strapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfx%2Flaravel-strapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfx%2Flaravel-strapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbfx","download_url":"https://codeload.github.com/dbfx/laravel-strapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfx%2Flaravel-strapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28668840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["hacktoberfest","laravel","laravel-package","strapi","strapi-cms"],"created_at":"2026-01-22T19:02:19.193Z","updated_at":"2026-01-22T19:05:19.572Z","avatar_url":"https://github.com/dbfx.png","language":"PHP","funding_links":["https://github.com/sponsors/dbfx"],"categories":[],"sub_categories":[],"readme":"# Laravel wrapper for using the Strapi headless CMS\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/dbfx/laravel-strapi.svg?style=flat-square)](https://packagist.org/packages/dbfx/laravel-strapi)\n[![Total Downloads](https://img.shields.io/packagist/dt/dbfx/laravel-strapi.svg?style=flat-square)](https://packagist.org/packages/dbfx/laravel-strapi)\n\n---\n\nLaravel-Strapi is a Laravel helper for using the Strapi headless CMS. \n\nNote: for Strapi v3 support use version 2.x.x\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require dbfx/laravel-strapi\n```\n\nYou can publish and run the migrations with:\n\nYou can publish the config file with:\n```bash\nphp artisan vendor:publish --provider=\"Dbfx\\LaravelStrapi\\LaravelStrapiServiceProvider\" --tag=\"strapi-config\"\n```\n\nYou need to define your STRAPI_URL and STRAPI_CACHE_TIME in .env:\nYou can also optionally define a STRAPI_TOKEN to enable authentication. Do not include 'Bearer' only the token itself.\n\n```\nSTRAPI_URL=https://strapi.test.com\nSTRAPI_CACHE_TIME=3600\nSTRAPI_TOKEN=abcd1234abcd1234\n```\n\n## Usage\n\nlaravel-strapi provides the collection() and entry() calls to return a full collection, or a specific entry from a collection. In the \nexample below we are querying the strapi collection 'blogs' and then getting the entry with id 1 from that collection.\n```php\nuse Dbfx\\LaravelStrapi\\LaravelStrapi;\n\n$strapi = new LaravelStrapi();\n$blogs = $strapi-\u003ecollection('blogs');\n$entry = $strapi-\u003eentry('blogs', 1);\n```\n\nThere are several useful options available as well. \n\n- ```$sortKey``` and ```$sortOrder``` allow you to specify the key to sort on and the direction\n- ```$fullUrls``` will automatically add your STRAPI_URL to the front of any relative URLs (e.g. images, etc).\n- ```$limit``` sets how many items you are requesting\n- ```$start``` is the offset to be used with limit, useful for pagination\n- ```$populate``` is an array containing the fields to populate\n- ```$queryData``` is an array of additional key-value pairs to add to the query string\n\n```php\nuse Dbfx\\LaravelStrapi\\LaravelStrapi;\n\n$strapi = new LaravelStrapi();\n$blogs = $strapi-\u003ecollection('blogs', $sortKey = 'id', $sortOrder = 'DESC', $limit = 20, $start = 0, $fullUrls = true, $populate = ['author', 'images'], $queryData = ['locale' =\u003e 'en']);\n\n$entry = $strapi-\u003eentry('blogs', 1, $fullUrls = true, $populate = ['author', 'images'], $queryData = ['locale' =\u003e 'en']);\n```\n\nYou may also access Single Type items as follows: \n\n```php\nuse Dbfx\\LaravelStrapi\\LaravelStrapi;\n\n$strapi = new LaravelStrapi();\n\n// Fetch the full homepage array\n$homepageArray = $strapi-\u003esingle('homepage');\n\n// Return just the ['content'] field from the homepage array\n$homepageItem = $strapi-\u003esingle('homepage', 'content');\n```\n\nAnd you may select entries by searching for a custom field (e.g. slug): \n\n```php\nuse Dbfx\\LaravelStrapi\\LaravelStrapi;\n\n$strapi = new LaravelStrapi();\n\n$entries = $strapi-\u003eentriesByField('blogs', 'slug', 'test-blog-post');\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Dave Blakey](https://github.com/dbfx)\n- [All Contributors](../../contributors)\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%2Fdbfx%2Flaravel-strapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbfx%2Flaravel-strapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbfx%2Flaravel-strapi/lists"}