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. [Utility &amp; Helpers](/categories/utility)
4. /
5. codemetry/laravel

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

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

Laravel adapter for Codemetry analysis pipeline

v1.4.0(3mo ago)014MITPHPPHP ^8.2

Since Feb 5Pushed 3mo agoCompare

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

READMEChangelog (9)Dependencies (5)Versions (12)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

39

—

LowBetter than 86% of packages

Maintenance81

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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 ~0 days

Total

11

Last Release

99d 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)")

###  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

[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)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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