PHPackages                             mubbi/laravel-commit-lint - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mubbi/laravel-commit-lint

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mubbi/laravel-commit-lint
=========================

It provides a Git hook to enforce Conventional Commits in Laravel projects.

v1.1.0(9mo ago)2494MITPHPPHP &gt;=8.2CI passing

Since Jul 28Pushed 9mo agoCompare

[ Source](https://github.com/mubbi/laravel-commit-lint)[ Packagist](https://packagist.org/packages/mubbi/laravel-commit-lint)[ RSS](/packages/mubbi-laravel-commit-lint/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Laravel Commit Lint [![Github actions Build](https://github.com/badges/poser/workflows/Build/badge.svg)](//packagist.org/packages/mubbi/laravel-commit-lint)
============================================================================================================================================================

[](#laravel-commit-lint-)

[![Latest Stable Version](https://camo.githubusercontent.com/682486b1847910716649e6b9c2cb76cf1f619c59308bed78fe72f2e160ff8453/68747470733a2f2f706f7365722e707567782e6f72672f6d756262692f6c61726176656c2d636f6d6d69742d6c696e742f76657273696f6e2e737667)](https://packagist.org/packages/mubbi/laravel-commit-lint)[![Total Downloads](https://camo.githubusercontent.com/653359759a6aa809b92c0ebaf208f19b05fbe1ed17d2bf77c2590b723be0949d/68747470733a2f2f706f7365722e707567782e6f72672f6d756262692f6c61726176656c2d636f6d6d69742d6c696e742f646f776e6c6f6164732e737667)](https://packagist.org/packages/mubbi/laravel-commit-lint)[![PHP Version Require](https://camo.githubusercontent.com/c0d22371905eb1acba9ea0e71abc082b8571988cde868864491500a9b3b4e90c/687474703a2f2f706f7365722e707567782e6f72672f6d756262692f6c61726176656c2d636f6d6d69742d6c696e742f726571756972652f706870)](https://packagist.org/packages/mubbi/laravel-commit-lint)[![Laravel Version Require](https://camo.githubusercontent.com/6e6a40847e2082aef0cc3639c72446e94cb3783f5ed9e8de2cfb79aa65ac4ba0/687474703a2f2f706f7365722e707567782e6f72672f6d756262692f6c61726176656c2d636f6d6d69742d6c696e742f726571756972652f696c6c756d696e6174652f737570706f7274)](https://packagist.org/packages/mubbi/laravel-commit-lint)[![Coverage Status](https://camo.githubusercontent.com/b77e556999b17f73eb0d7c7fa313299266bca4f23d0e2885b27f94011b47389c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d756262692f6c61726176656c2d636f6d6d69742d6c696e742f62616467652e7376673f6272616e63683d666561747572652f636f766572616c6c732d6769746875622d616374696f6e)](https://coveralls.io/github/mubbi/laravel-commit-lint?branch=feature/coveralls-github-action)

Requirements
------------

[](#requirements)

- Laravel &gt;= 12.0
- PHP &gt;= 8.2

Overview
--------

[](#overview)

Laravel Commit Lint helps teams enforce [Conventional Commits](https://www.conventionalcommits.org/) in Laravel projects by automatically validating commit messages using a Git hook. This ensures consistent commit history and enables better automation and tooling.

Features
--------

[](#features)

- Automatic commit message validation using a `commit-msg` hook
- Customizable hook installation path via Artisan command
- Clear error messages and guidance for invalid commit messages
- Skips validation for merge, WIP, and revert commits
- Extensible via Laravel’s service provider and command structure

Installation
------------

[](#installation)

```
composer require mubbi/laravel-commit-lint --dev
php artisan commitlint:install
```

Usage
-----

[](#usage)

After installation, every commit will be checked for Conventional Commit compliance.

If your message does not match the required format, the commit will be rejected with guidance.

### Example of valid commit messages

[](#example-of-valid-commit-messages)

- feat: add user authentication
- fix: resolve issue with email validation
- docs: update API documentation
- refactor: improve query performance
- chore: update dependencies
- style: format code according to PSR-12
- test: add unit tests for login

### Example of invalid commit messages

[](#example-of-invalid-commit-messages)

- updated stuff
- bug fix
- changes
- fixed it
- wip: working on something (WIP is skipped, but not recommended for final commits)

How it works
------------

[](#how-it-works)

After installation, the package places a `commit-msg` hook in your `.git/hooks` directory (or a custom path if specified). This hook runs on every commit and checks your commit message against the Conventional Commits specification using a regex. If the message is invalid, the commit is rejected and guidance is shown.

The validation script automatically skips validation for merge, WIP, and revert commits.

Configuration
-------------

[](#configuration)

You can install the hook to a custom path:

```
php artisan commitlint:install /custom/path/to/commit-msg
```

You may also specify a custom stub file for the hook script:

```
php artisan commitlint:install --stub=/path/to/custom-stub
```

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

- **Hook not working:** Ensure your repository has a `.git/hooks` directory and that the `commit-msg` file is executable (`chmod +x .git/hooks/commit-msg`).
- **Artisan command not found:** Make sure the package is installed as a dev dependency and your Laravel app's autoload files are up to date (`composer dump-autoload`).
- **Commit rejected unexpectedly:** Check your commit message format and ensure it matches the Conventional Commits spec. See valid examples above.
- **Custom hook path not working:** Verify the path exists and is writable.

If you encounter other issues, please [open an issue on GitHub](https://github.com/mubbi/laravel-commit-lint/issues) with details.

Uninstallation
--------------

[](#uninstallation)

To remove the commit lint hook, simply delete the `commit-msg` file from your `.git/hooks` directory:

```
rm .git/hooks/commit-msg
```

To remove the package:

```
composer remove mubbi/laravel-commit-lint
```

FAQ
---

[](#faq)

**Q: Does this work with all git clients?**A: Yes, as long as your client supports git hooks.

**Q: Can I customize the commit message rules?**A: You can modify the stub or extend the validation logic in the package.

**Q: Will this block merge commits?**A: No, merge, WIP, and revert commits are skipped.

Contributing
------------

[](#contributing)

Contributions are welcome! Please open issues or submit pull requests via GitHub. Follow Conventional Commits for your messages.

For questions and discussions, visit [GitHub Discussions](https://github.com/mubbi/laravel-commit-lint/discussions).

For more details, see the [Contributing Guide](.github/CONTRIBUTING.md).

License
-------

[](#license)

This project is licensed under the [MIT License](LICENSE).

Security
--------

[](#security)

Please refer to our [Security Policy](.github/SECURITY.md) for reporting vulnerabilities and security concerns.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance56

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

293d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9a307392bd8249c2a6b83fd543d4a608430dcb5fed81e96fd4dfcb91505bb0c?d=identicon)[mubbi](/maintainers/mubbi)

---

Top Contributors

[![mubbi](https://avatars.githubusercontent.com/u/6255767?v=4)](https://github.com/mubbi "mubbi (20 commits)")

---

Tags

conventional-commitsgitgit-commit-messagesgit-hooklaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mubbi-laravel-commit-lint/health.svg)

```
[![Health](https://phpackages.com/badges/mubbi-laravel-commit-lint/health.svg)](https://phpackages.com/packages/mubbi-laravel-commit-lint)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
