PHPackages                             codemetry/laravel - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. codemetry/laravel

ActiveLibrary[Testing &amp; Quality](/categories/testing)

codemetry/laravel
=================

Laravel adapter for Codemetry analysis pipeline

v1.4.1(1mo ago)119MITPHPPHP ^8.2

Since Feb 5Pushed 1mo agoCompare

[ Source](https://github.com/albertoarena/codemetry-laravel)[ Packagist](https://packagist.org/packages/codemetry/laravel)[ RSS](/packages/codemetry-laravel/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (10)Versions (13)Used By (0)

Codemetry Laravel
=================

[](#codemetry-laravel)

Laravel adapter for Codemetry - provides Artisan commands and service provider integration for Git repository analysis.

This package depends on [codemetry/core](https://github.com/albertoarena/codemetry-core).

**[Documentation](https://albertoarena.github.io/codemetry)** | **[Getting Started](https://albertoarena.github.io/codemetry/getting-started/installation/)**

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

[](#requirements)

- PHP 8.2+
- Laravel 11.x or 12.x
- Git

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

[](#installation)

```
composer require codemetry/laravel
```

This automatically installs `codemetry/core` as a dependency.

Publish the configuration file:

```
php artisan vendor:publish --tag=codemetry-config
```

Upgrading
---------

[](#upgrading)

Both `codemetry/laravel` and `codemetry/core` must be updated together to ensure compatibility:

```
composer update "codemetry/*"
```

Or explicitly:

```
composer update codemetry/laravel codemetry/core
```

> **Note:** Running `composer update codemetry/laravel` alone may not work because both packages are versioned together and require matching versions.

Usage
-----

[](#usage)

```
# Table output (one row per day)
php artisan codemetry:analyze --days=7

# JSON output
php artisan codemetry:analyze --days=7 --format=json

# Filter by author or branch
php artisan codemetry:analyze --days=7 --author="Jane Doe" --branch=main

# Specify date range
php artisan codemetry:analyze --since=2024-01-01 --until=2024-01-31

# Enable AI-powered explanations (requires API keys in config)
php artisan codemetry:analyze --days=7 --ai=1
```

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

[](#configuration)

After publishing, edit `config/codemetry.php`:

```
return [
    // Number of days to analyze by default
    'days' => 7,

    // Baseline period for normalization (in days)
    'baseline_days' => 56,

    // Follow-up fix detection horizon (in days)
    'follow_up_horizon_days' => 3,

    // AI configuration (optional)
    'ai' => [
        'enabled' => false,
        'engine' => 'openai', // openai, anthropic, deepseek, google
        'api_key' => env('CODEMETRY_AI_API_KEY'),
    ],
];
```

AI Integration
--------------

[](#ai-integration)

AI integration is **opt-in** and **metrics-only**. Engines never receive raw code or diffs.

Supported engines:

- OpenAI
- Anthropic (Claude)
- DeepSeek
- Google

When AI is requested but unavailable (missing keys, API failure), analysis continues normally with a warning.

Privacy
-------

[](#privacy)

- The AI engine receives **aggregated metrics only** - never raw source code, full diffs, or file contents.
- All analysis runs locally via Git commands against your repository.
- No data is sent to external services unless AI engines are explicitly enabled.

License
-------

[](#license)

MIT

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance89

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% 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 ~8 days

Recently: every ~22 days

Total

12

Last Release

58d ago

### Community

Maintainers

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

---

Top Contributors

[![albertoarena](https://avatars.githubusercontent.com/u/1126630?v=4)](https://github.com/albertoarena "albertoarena (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

artisan-commandcode-metricscode-qualitycomposer-packagedeveloper-toolsgit-analysislaravellaravel-packagephpstatic-analysis

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/codemetry-laravel/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M150](/packages/laravel-mcp)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725172.4k14](/packages/tallstackui-tallstackui)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)

PHPackages © 2026

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