{"id":20812444,"url":"https://github.com/markwalet/laravel-git-state","last_synced_at":"2026-04-02T14:04:01.697Z","repository":{"id":35045216,"uuid":"200247837","full_name":"markwalet/laravel-git-state","owner":"markwalet","description":"A Laravel package that gives you information about the current git state.","archived":false,"fork":false,"pushed_at":"2026-03-26T18:52:46.000Z","size":117,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-27T06:24:07.516Z","etag":null,"topics":["git","laravel","php","php-package"],"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/markwalet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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,"zenodo":null},"funding":{"github":"markwalet","custom":["https://www.paypal.me/markwalet"]}},"created_at":"2019-08-02T14:22:24.000Z","updated_at":"2026-03-26T18:50:23.000Z","dependencies_parsed_at":"2023-11-27T17:49:43.096Z","dependency_job_id":"ecae2483-fe85-413b-b38e-3c13149e257e","html_url":"https://github.com/markwalet/laravel-git-state","commit_stats":{"total_commits":92,"total_committers":2,"mean_commits":46.0,"dds":"0.11956521739130432","last_synced_commit":"c8e13d65819ade36c900f9afb50642fad4ab6856"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/markwalet/laravel-git-state","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-git-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-git-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-git-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-git-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markwalet","download_url":"https://codeload.github.com/markwalet/laravel-git-state/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-git-state/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["git","laravel","php","php-package"],"created_at":"2024-11-17T20:54:29.299Z","updated_at":"2026-04-02T14:04:01.685Z","avatar_url":"https://github.com/markwalet.png","language":"PHP","funding_links":["https://github.com/sponsors/markwalet","https://www.paypal.me/markwalet"],"categories":[],"sub_categories":[],"readme":"# Laravel Git State\n\n[![Build Status](https://github.com/markwalet/laravel-git-state/workflows/tests/badge.svg)](https://github.com/markwalet/laravel-git-state/actions)\n[![Total Downloads](https://img.shields.io/packagist/dt/markwalet/laravel-git-state)](https://packagist.org/packages/markwalet/laravel-git-state)\n[![Latest Stable Version](https://img.shields.io/packagist/v/markwalet/laravel-git-state)](https://packagist.org/packages/markwalet/laravel-git-state)\n[![License](https://img.shields.io/packagist/l/markwalet/laravel-git-state)](https://packagist.org/packages/markwalet/laravel-git-state)\n\nA Laravel package that gives you information about the current git state.\n\n## Installation\nYou can install this package with composer:\n\n```shell\ncomposer require markwalet/laravel-git-state\n```\n\nThe package supports PHP 8.2+ and Laravel 12+.\n\nLaravel auto-loads service providers for you, so you don't have to register it. If you want to register the service provider manually, add the following line to your `config/app.php` file:\n\n```php\nMarkWalet\\GitState\\GitStateServiceProvider::class\n```\n\n## Usage\nWhen you want to get information about the current git state, you can inject the `MarkWalet\\GitState\\Drivers\\GitDriver` class in your methods:\n\n```php\n\u003c?php\n\nuse MarkWalet\\GitState\\Drivers\\GitDriver;\n\nclass Controller {\n    \n    public function index(GitDriver $driver) {\n        $branch = $driver-\u003ecurrentBranch();\n        $commit = $driver-\u003elatestCommitHash();\n        $timestamp = $driver-\u003elatestCommitTimestamp(); // Carbon instance\n        $title = $driver-\u003elatestCommitTitle();\n        $description = $driver-\u003elatestCommitDescription();\n        \n        return view('index', compact('branch', 'commit', 'timestamp', 'title', 'description'));\n    }\n}\n```\nWhen injecting a GitDriver like this, you will get an instance of the default driver you configured. If you want to have more control over the driver you are using, you can use the `MarkWalet\\GitState\\GitManager`:\n\n```php\n\u003c?php\n\nuse MarkWalet\\GitState\\GitStateManager;\n\nclass Controller {\n    \n    public function index(GitStateManager $driver) {\n        $branch = $driver-\u003edriver('other-driver')-\u003ecurrentBranch();\n        \n        return view('index', compact('branch'));\n    }\n}\n```\n## Configuration\n\nThe default configuration is defined in `git-state.php`. If you want to edit this file you can copy it to your config folder by using the following command:\n```shell\nphp artisan vendor:publish --provider=\"MarkWalet\\GitState\\GitServiceProvider\"\n```\n\nIn this file you can configure different drivers for fetching the current Git state, as well as setting a default configuration.\n\nThe supported drivers are: `exec` and `file`. There is also a `fake` implementation for testing purposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwalet%2Flaravel-git-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkwalet%2Flaravel-git-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwalet%2Flaravel-git-state/lists"}