{"id":17398927,"url":"https://github.com/noweh/laravel-headless","last_synced_at":"2025-09-09T14:33:34.293Z","repository":{"id":102998616,"uuid":"412063927","full_name":"noweh/laravel-headless","owner":"noweh","description":"Fast and simple implementation of a REST API based on the Laravel Framework, Repository Pattern, Eloquent Resources, Translatability, and Swagger.","archived":false,"fork":false,"pushed_at":"2021-09-30T18:57:55.000Z","size":790,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T04:11:18.521Z","etag":null,"topics":["api","headless-cms","laravel","php"],"latest_commit_sha":null,"homepage":"","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/noweh.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-30T12:54:16.000Z","updated_at":"2024-02-10T15:24:05.000Z","dependencies_parsed_at":"2023-03-13T03:32:34.953Z","dependency_job_id":null,"html_url":"https://github.com/noweh/laravel-headless","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noweh%2Flaravel-headless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noweh%2Flaravel-headless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noweh%2Flaravel-headless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noweh%2Flaravel-headless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noweh","download_url":"https://codeload.github.com/noweh/laravel-headless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249183834,"owners_count":21226269,"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":["api","headless-cms","laravel","php"],"created_at":"2024-10-16T15:03:29.851Z","updated_at":"2025-04-16T02:23:03.550Z","avatar_url":"https://github.com/noweh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Headless\n\n## What about?\n\nThis allows a fast and simple implementation of a REST API based on the [Laravel Framework](https://packagist.org/packages/laravel/laravel), [Repository Pattern](https://designpatternsphp.readthedocs.io/en/latest/More/Repository/README.html), [Eloquent Resources](https://laravel.com/docs/8.x/eloquent-resources), [Translatability](https://packagist.org/packages/astrotomic/laravel-translatable), and [Swagger](https://swagger.io/) for the documentation.\n\nThe objective is to have the least code to write for adding new kind of content: the most important process is carried out in the Abstract files.\n\nIn a development environment, the display of the Debugbar ([barryvdh/laravel-debugbar](https://packagist.org/packages/barryvdh/laravel-debugbar)) has been modified in a Middleware to integrate with the json return.\n\n## Cache\n\nSeveral levels of caches are used to optimize the display: a first one with the bundle [genealabs/laravel-model-caching](https://packagist.org/packages/genealabs/laravel-model-caching) for Objects, a second one in the process of the Resources display, and a third one with a configurable Cache-Control in Header.\n\nBy default, GET routes are behind cache. To remove that, you have to add the following GET parameter:\n`removeCache=true`\n\n## Requirements\n\nHere are the requirements for the project:\n\n- [PHP 7.3](http://www.php.net)\n- [MySql 5.7](https://www.mysql.com)\n- [Composer 2](https://getcomposer.org) (installed as an executable)\n\n## Procedures\n\n#### To install the project:\n\n- Create one vhost with documentRoot positionned on \"website/public\"\n- Duplicate **website/.env.example** to **website/.env** \n- Modify **website/.env** with expected data (mainly DB parameters)\n- Run the script:\n\n```\nsh scripts/install.sh\n```\n\nIf for some reasons your project stop working, do the following:\n\n```\ncd website\ncomposer install\nphp artisan migrate\n```\n\n## Commands\n\n- To refresh cache, do the following:\n```\ncd website\nsh scripts/refresh_cache.sh\n```\n- To reset database:\n```\ncd website\nsh scripts/reset_database.sh\n```\n- To reset database with default user:\n```\ncd website\nsh scripts/generate_data.sh\n```\n- To update existing database:\n```\ncd website\nphp artisan migrate\n```\n- To launch all API Commands with configured schedule, add in crontab the following:\n```\n* * * * * cd /path-to-your-project \u0026\u0026 php artisan schedule:run\n```\n\n## Swagger\n\n- You can access to the Swagger interface from url : {APP_URL}/api. {APP_URL} is setted in your .env file\n- To regenerate the documentation, you can run the following command:\n```\ncd website\nphp artisan l5-swagger:generate\n```\n- Alternatively, you can set `L5_SWAGGER_GENERATE_ALWAYS` to `true` in your .env file. It will allow your documentation to be automatically generated.\n\nYou can **retrieve an User Token** from the route /users/auth/login in Authentication Tag on Swagger interface.\u003cbr /\u003e\nCopy this token and past it in \"Authorize\" button (see above right of the Swagger interface) to activate the JWT mode","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoweh%2Flaravel-headless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoweh%2Flaravel-headless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoweh%2Flaravel-headless/lists"}