Appearance
GitHooksActivator
php
final readonly class Zairakai\LaravelDevTools\Services\GitHooksActivatorActivates the git hooks of zairakai/laravel-dev-tools.
The hooks are the same for every PHP project of zairakai: git reads them in place through git config core.hooksPath vendor/zairakai/laravel-dev-tools/stubs/githooks, nothing is copied into the project. They run the Composer scripts of the project: quality:fast before a commit, quality before a push.
Source: src/Services/GitHooksActivator.php
Constants
| Name | Value | Description |
|---|---|---|
HOOKS_PATH | 'vendor/zairakai/laravel-dev-tools/stubs/githooks' | The hooks directory, relative to the root of the project. |
Methods
__construct()
php
public function __construct(PublishOutput $output)activate()
php
public function activate(string $basePath): boolPoint core.hooksPath of the project at the hooks of laravel-dev-tools.
| Parameter | Description |
|---|---|
$basePath | Absolute path to the project root |
Returns bool True when git is configured