{"id":23412518,"url":"https://gitlab.com/tjvb/gitlab-models-for-laravel","last_synced_at":"2025-04-12T03:42:35.127Z","repository":{"id":56790612,"uuid":"32029534","full_name":"tjvb/gitlab-models-for-laravel","owner":"tjvb","description":"Store the data form the GitLab hooks in your Laravel projects database.","archived":false,"fork":false,"pushed_at":null,"size":null,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":null,"default_branch":"master","last_synced_at":"2024-09-16T02:23:56.511Z","etag":null,"topics":["gitlab","hacktoberfest","laravel"],"latest_commit_sha":null,"homepage":null,"language":null,"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://gitlab.com/uploads/-/system/project/avatar/32029534/logo_1__1__1_.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":"2021-12-10T21:02:23.023Z","updated_at":"2024-03-13T08:19:38.197Z","dependencies_parsed_at":"2022-08-22T17:20:52.456Z","dependency_job_id":null,"html_url":"https://gitlab.com/tjvb/gitlab-models-for-laravel","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/tjvb%2Fgitlab-models-for-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/tjvb%2Fgitlab-models-for-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/tjvb%2Fgitlab-models-for-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/tjvb%2Fgitlab-models-for-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners/tjvb","download_url":"https://gitlab.com/tjvb/gitlab-models-for-laravel/-/archive/master/gitlab-models-for-laravel-master.zip","host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","repositories_count":4518633,"owners_count":6928,"icon_url":"https://github.com/gitlab.png","version":null,"created_at":"2022-05-30T11:31:42.605Z","updated_at":"2024-07-18T11:24:13.055Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners"}},"keywords":["gitlab","hacktoberfest","laravel"],"created_at":"2024-12-22T18:16:14.952Z","updated_at":"2025-04-12T03:42:35.105Z","avatar_url":"https://gitlab.com/uploads/-/system/project/avatar/32029534/logo_1__1__1_.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitLab Models for Laravel\n\n[![Latest Stable Version](https://poser.pugx.org/tjvb/gitlab-models-for-laravel/v)](https://packagist.org/packages/tjvb/gitlab-models-for-laravel)\n[![Pipeline status](https://gitlab.com/tjvb/gitlab-models-for-laravel/badges/master/pipeline.svg)](https://gitlab.com/tjvb/gitlab-models-for-laravel/-/pipelines?page=1\u0026scope=all\u0026ref=master)\n[![Coverage report](https://gitlab.com/tjvb/gitlab-models-for-laravel/badges/master/coverage.svg)](https://gitlab.com/tjvb/gitlab-models-for-laravel/-/pipelines?page=1\u0026scope=all\u0026ref=master)\n[![Tested on PHP 8.1 to 8.4](https://img.shields.io/badge/Tested%20on-PHP%208.1%20|%208.2%20|%208.3|%208.4-brightgreen.svg?maxAge=2419200)](https://gitlab.com/tjvb/gitlab-models-for-laravel/-/pipelines?page=1\u0026scope=all\u0026ref=master)\n[![Tested on Laravel 9 to 10](https://img.shields.io/badge/Tested%20on-Laravel%209%20|%2010-brightgreen.svg?maxAge=2419200)](https://gitlab.com/tjvb/laravel-mail-catchall/-/pipelines?page=1\u0026scope=all\u0026ref=master)\n[![Latest Unstable Version](https://poser.pugx.org/tjvb/gitlab-models-for-laravel/v/unstable)](https://packagist.org/packages/tjvb/gitlab-models-for-laravel)\n\n\n[![PHP Version Require](https://poser.pugx.org/tjvb/gitlab-models-for-laravel/require/php)](https://packagist.org/packages/tjvb/gitlab-models-for-laravel)\n[![Laravel Version Require](https://poser.pugx.org/tjvb/gitlab-models-for-laravel/require/laravel/framework)](https://packagist.org/packages/tjvb/laravel-mail-catchall)\n[![PHPMD](https://img.shields.io/badge/PHPMD-checked-brightgreen.svg)](https://gitlab.com/tjvb/gitlab-models-for-laravel/-/blob/master/phpmd.xml.dist)\n[![PHPStan](https://img.shields.io/badge/PHPStan-checked-brightgreen.svg)](https://gitlab.com/tjvb/gitlab-models-for-laravel/-/blob/master/phpstan.neon.dist)\n[![ECS](https://img.shields.io/badge/ECS-PSR12-brightgreen.svg)](https://gitlab.com/tjvb/gitlab-models-for-laravel/-/blob/master/ecs.php)\n\n\n[![License](https://poser.pugx.org/tjvb/gitlab-models-for-laravel/license)](https://packagist.org/packages/tjvb/gitlab-models-for-laravel)\n\n## Purpose\n\nGitLab push data for different objects with its webhook, this package provides the option to store that data in your database. Under the hood it use [tjvb/gitlab-webhooks-receiver-for-laravel](https://gitlab.com/tjvb/gitlab-webhooks-receiver-for-laravel/) for receiving the webhook data. After storing the data it will dispatch an event that can be used to update other parts of your data or react on the new input.\n\n## Installation\n\n1. You can install the package via composer:\n```bash\ncomposer require tjvb/gitlab-models-for-laravel\n```\n\n2. You can publish and run the migrations for GitLab Models for Laravel and GitLab Webhooks with:\n\n```bash\nphp artisan vendor:publish --provider=\"TJVB\\GitLabWebhooks\\GitLabWebhooksServiceProvider\" --tag=\"migrations\"\nphp artisan vendor:publish --provider=\"TJVB\\GitlabModelsForLaravel\\Providers\\GitlabModelsProvider\" --tag=\"migrations\"\nphp artisan migrate\n```\n\n3. Set the `GITLAB_WEBHOOK_SECRET` env variable (most used version is to set it in the .env file) to have the token you use for your webhook. See [https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#secret-token](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#secret-token \"the GitLab documentation\") for more information.\n4. Create a webhook in GitLab.\n   You can create a webhook in GitLab for your project, group or system. The default url is `\u003capplication.tld\u003e/gitlabwebhook` this can be changed in the configuration from [tjvb/gitlab-webhooks-receiver-for-laravel](https://gitlab.com/tjvb/gitlab-webhooks-receiver-for-laravel/).\n5. Optional configure the package.\n6. Listen to the events\n\n### Manual register the service provider.\nIf you disable the package discovery you need to add `\\TJVB\\GitlabModelsForLaravel\\Providers\\GitlabModelsProvider::class,` and `\\TJVB\\GitLabWebhooks\\GitLabWebhooksServiceProvider::class,` to the providers array in `config/app.php`.\n\n\n## Events\n\nThe package dispatched multiple events after saving the received data (a create or update) The event contains the new data.\n\n* `TJVB\\GitlabModelsForLaravel\\Events\\BuildDataReceived`\n* `TJVB\\GitlabModelsForLaravel\\Events\\DeploymentDataReceived`\n* `TJVB\\GitlabModelsForLaravel\\Events\\IssueDataReceived`\n* `TJVB\\GitlabModelsForLaravel\\Events\\MergeRequestDataReceived`\n* `TJVB\\GitlabModelsForLaravel\\Events\\NoteDataReceived`\n* `TJVB\\GitlabModelsForLaravel\\Events\\PipelineDataReceived`\n* `TJVB\\GitlabModelsForLaravel\\Events\\ProjectDataReceived`\n* `TJVB\\GitlabModelsForLaravel\\Events\\TagDataReceived`\n\n\n## Configuration\n\n### Env variables\nThere are a couple of env variables that can be used to change the data that should be stored.\n\n| Key | Default | Description                                                                                       |\n|-----|---------|---------------------------------------------------------------------------------------------------|\n|`GITLAB_MODELS_QUEUE_CONNECTION`| null    | The queue connection for the HookStoredListener, if not provided it will use the project default. |\n|`GITLAB_MODELS_QUEUE_QUEUE`| null    | The queue for the HookStoredListener, if not provided it will use the project default.      |\n|`GITLAB_MODELS_STORE_BUILDS`| true    | That we want to store the data from the builds.                                                   |\n|`GITLAB_MODELS_STORE_DEPLOYMENTS`| true    | That we want to store the data from the deployments.                                              |\n|`GITLAB_MODELS_STORE_ISSUES`| true    | That we want to store the data from the issues.                                                   |\n|`GITLAB_MODELS_STORE_MERGE_REQUESTS`| true    | That we want to store the data from the merge requests.                                           |\n|`GITLAB_MODELS_STORE_NOTES`| true    | That we want to store the data from the notes (comments).                                         |\n|`GITLAB_MODELS_STORE_PIPELINES`| true    | That we want to store the data from the pipelines.                                                |\n|`GITLAB_MODELS_STORE_PROJECTS`| true    | That we want to store the data from the projects.                                                 |\n|`GITLAB_MODELS_STORE_TAGS`| true    | That we want to store the data from the tags.                                                     |\n\n### Customization\nYou can publish the config file with:\n```bash\nphp artisan vendor:publish --provider=\"TJVB\\GitlabModelsForLaravel\\Providers\\GitlabModelsProvider\" --tag=\"config\"\n```\n\n### Security\nThe default configuration validates the `X-Gitlab-Token` in the header of the webhook request. It is possible to add multiple values in the config file or disabling the middleware to stop the verification. If you need more validation for the request (as example and i.p. filter) you can add more middleware to the configuration.\n\n## Changelog\nWe (try to) document all the changes in [CHANGELOG](CHANGELOG.md) so read it for more information.\n\n## Contributing\nYou are welcome to contribute, read about it in [CONTRIBUTING](CONTRIBUTING.md)\n\n## Security\nIf you discover any security related issues, please email info@tjvb.nl instead of using the issue tracker.\n\n## Credits\n\n- [Tobias van Beek](https://tjvb.nl/about)\n- [All Contributors](https://gitlab.com/tjvb/gitlab-models-for-laravel/-/graphs/master)\n\n## Thanks to\n- [GitLab](https://gitlab.com) for the great product, without that this package isn't needed.\n\n## License\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Ftjvb%2Fgitlab-models-for-laravel","html_url":"https://awesome.ecosyste.ms/projects/gitlab.com%2Ftjvb%2Fgitlab-models-for-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Ftjvb%2Fgitlab-models-for-laravel/lists"}