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.2(1w ago)183MITPHPPHP ^8.2

Since Feb 5Pushed 1w agoCompare

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

READMEChangelog (10)Dependencies (15)Versions (14)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.

📬 Stay updated
--------------

[](#-stay-updated)

Occasional emails on Laravel tooling and AI-assisted development: new releases, packages, and write-ups. No spam, unsubscribe anytime.

**[Subscribe to the newsletter →](https://albertoarena.it/subscribe/?utm_source=codemetry&utm_medium=readme&utm_campaign=newsletter&utm_content=codemetry-laravel)**

License
-------

[](#license)

MIT

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance98

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% 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 ~15 days

Recently: every ~44 days

Total

13

Last Release

11d 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 (13 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

[laravel/sail

Docker files for running a basic Laravel application.

1.9k212.4M1.5k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M319](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M227](/packages/laravel-mcp)[tallstackui/tallstackui

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

731189.9k16](/packages/tallstackui-tallstackui)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)

PHPackages © 2026

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