PHPackages                             laravel-assist/assistant - 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. laravel-assist/assistant

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

laravel-assist/assistant
========================

AI-powered code analysis, security auditing, and health reporting for Laravel applications

00

Since Jul 6Compare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Assistant
=================

[](#laravel-assistant)

AI-powered code analysis, security auditing, and health reporting for Laravel applications.

[![Latest Stable Version](https://camo.githubusercontent.com/bcce05c03985e259939ac7679c515eb8e983f1cce4b52a7ae52dd86e11cd5320/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d6173736973742f617373697374616e742f762f737461626c65)](https://packagist.org/packages/laravel-assist/assistant)[![License](https://camo.githubusercontent.com/0dadfee608de7c8b10c83e61c8ce5b7755a82240eb5fd8ccd3907d83f741be2e/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d6173736973742f617373697374616e742f6c6963656e7365)](https://packagist.org/packages/laravel-assist/assistant)[![Tests](https://github.com/laravel-assist/assistant/actions/workflows/tests.yml/badge.svg)](https://github.com/laravel-assist/assistant/actions)

Features
--------

[](#features)

- **Missing Database Indexes** - Detect columns used in WHERE/JOIN without indexes
- **N+1 Query Detection** - Find relationships accessed without eager loading
- **Unused Code Detection** - Routes, controllers, views, service providers, dead code
- **Security Warnings** - Mass assignment, debug settings, missing rate limits
- **Cache &amp; Queue Analysis** - Cache opportunities and queue bottleneck detection
- **Model Diagrams** - Generate Mermaid ER diagrams from Eloquent relationships
- **Health Reports** - Comprehensive deployment readiness reports
- **AI Enhancement** - Optional OpenAI/Claude integration for enriched recommendations

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

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

[](#installation)

```
composer require laravel-assist/assistant
```

The service provider is auto-discovered. No manual registration needed.

Publish the config file:

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

Usage
-----

[](#usage)

### Run Full Analysis

[](#run-full-analysis)

```
php artisan assistant:analyze
```

### Analyze Specific Categories

[](#analyze-specific-categories)

```
php artisan assistant:analyze --only=security
php artisan assistant:analyze --only=database,performance
```

### Security Scan

[](#security-scan)

```
php artisan assistant:security
```

### Generate Health Report

[](#generate-health-report)

```
php artisan assistant:report
php artisan assistant:report --format=html --output=report.html
```

### Generate Diagrams

[](#generate-diagrams)

```
php artisan assistant:diagram --type=model
php artisan assistant:diagram --type=dependency --output=graph.md
```

### Enable AI Enhancement

[](#enable-ai-enhancement)

Set environment variables:

```
ASSISTANT_AI_ENABLED=true
ASSISTANT_AI_PROVIDER=openai
ASSISTANT_AI_API_KEY=your-api-key
```

Then run with the `--ai` flag:

```
php artisan assistant:analyze --ai
```

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

[](#configuration)

The published config file at `config/assistant.php` allows you to:

- Enable/disable specific analyzers
- Exclude paths from analysis
- Configure AI providers (OpenAI/Claude)
- Set minimum severity levels
- Configure diagram output

Output Formats
--------------

[](#output-formats)

CommandFormats`assistant:analyze``table`, `json``assistant:security``table`, `json``assistant:report``console`, `json`, `html``assistant:diagram`Mermaid (stdout or file)Health Score
------------

[](#health-score)

The health score is calculated as:

- Starting at 100 points
- Critical issues: -15 points each
- Warnings: -5 points each
- Info: -1 point each

ScoreMeaning80-100Excellent - ready for deployment50-79Good - consider addressing warnings0-49Needs work - critical issues detectedExtending
---------

[](#extending)

### Custom Analyzer

[](#custom-analyzer)

Create a class implementing `AnalyzerInterface`:

```
use LaravelAssist\Assistant\Contracts\AnalyzerInterface;
use LaravelAssist\Assistant\Support\LaravelInspector;

class MyCustomAnalyzer implements AnalyzerInterface
{
    public function analyze(LaravelInspector $inspector): array
    {
        $findings = [];
        // Your analysis logic here
        return $findings;
    }

    public function getName(): string
    {
        return 'My Custom Check';
    }

    public function getDescription(): string
    {
        return 'Description of what this checks.';
    }

    public function getCategory(): string
    {
        return 'custom';
    }
}
```

Register via a service provider:

```
use LaravelAssist\Assistant\AI\RulesEngine;

$this->app->booted(function ($app) {
    $engine = $app->make(RulesEngine::class);
    $engine->registerAnalyzer('my_custom', new MyCustomAnalyzer());
});
```

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

9

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

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.

### Community

Maintainers

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

### Embed Badge

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

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

PHPackages © 2026

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