Download the PHP package givanov95/laravel-git-hooks without Composer

On this page you can find all versions of the php package givanov95/laravel-git-hooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-git-hooks

laravel-git-hooks

A tiny Composer plugin that wires a pre-commit git hook into your Laravel + Vite projects. On every commit it runs your quality gate; if any step fails, the commit is aborted.

It is intentionally small and self-contained — one bash hook plus a few lines of PHP to install it. The hook is the authoritative source of truth, versioned in this package, so every project that requires it stays in sync.

Heads-up: a local git hook is a fast-feedback gate, not a security boundary — it is trivially bypassed (--no-verify) and only runs for people who have it installed. Pair it with CI (GitHub Actions) for the real, enforced gate.

What the hook runs

Each step is skipped gracefully when its tooling isn't present, so the same hook works across projects with different setups:

  1. php-cs-fixer — formats staged *.php files (needs vendor/bin/php-cs-fixer + a .php-cs-fixer.php / .php-cs-fixer.dist.php config), then re-stages them.
  2. Debug-statement guard — blocks the commit if staged *.php/*.vue/*.js/*.ts files contain console.log(, dd( or dump(.
  3. Vite build — runs npm run build only when frontend files are staged and a build script exists in package.json.
  4. Tests — runs php artisan test (or vendor/bin/phpunit).

Installation

That's it. The plugin installs the hook into .git/hooks/pre-commit after install/update. Because it's a plugin, Composer will ask you to trust it the first time (or add it to allow-plugins in your project's composer.json):

If a hand-written pre-commit already exists, it is backed up to pre-commit.local.bak.

Manual install (plugins disabled)

Bypassing & skipping

Goal How
Skip everything for one commit git commit --no-verify
Skip every step (keep the hook) SKIP_HOOK=1 git commit ...
Skip just the build SKIP_BUILD=1 git commit ...
Skip just the tests SKIP_TESTS=1 git commit ...
Skip php-cs-fixer SKIP_CSFIXER=1 git commit ...

Requirements

License

MIT © Georgi Ivanov


All versions of laravel-git-hooks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
composer-plugin-api Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package givanov95/laravel-git-hooks contains the following files

Loading the files please wait ...