markwalet/laravel-git-state
Laravel Git State exposes your repository's git information inside your Laravel app, letting you read the current branch, commit hash, tag, and dirty status through a simple API so you can surface version details in dashboards, health checks, or deployment tooling.
composer require --dev only if you intend to use it purely for test faking; otherwise install as a normal dependency so the GitManager and its bindings are available in production code paths.config/git.php or similar) for the default driver and any driver-specific connection/credential blocks. This is where you choose between the real driver and FakeGitDriver.app(GitManager::class)) and pull a driver, or — more commonly — swap the driver to FakeGitDriver inside a test so git operations are deterministic and do not touch the filesystem or a remote.FakeGitDriver was only just restored in v1.11.2, confirm your locked version is >=1.11.2 before writing tests against it; earlier 1.11.x releases will not have it.setUp (or a dedicated trait), call the manager's fake/swap method to replace the default driver with FakeGitDriver. Assert against the fake's recorded calls rather than shelling out to real git.default at the real driver in production and let your test suite override it to the fake. This avoids scattering if (app()->environment('testing')) checks through application code.extend-style hook in a service provider. Useful if you need a wrapper around a specific git host or a recording driver with richer assertions than the built-in fake.FakeGitDriver is intended for testing and non-production use only. Guard against it accidentally being the configured default in staging/production — add a config assertion or an environment check in a bootstrap/service provider.tearDown, or use RefreshDatabase-style isolation plus an explicit manager reset.php artisan config:cache bakes in the value. Changing drivers at runtime after caching requires config:clear or a runtime swap through the manager.^1.11.2 in composer.json to avoid landing on a 1.11.x build without FakeGitDriver. Check composer.lock after upgrading.How can I help you explore Laravel packages today?