PHPackages                             argent/laravel-mint - 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. argent/laravel-mint

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

argent/laravel-mint
===================

Realistic test data generator for Laravel.

v1.0.1(8mo ago)00MITPHPPHP ^8.2CI passing

Since Sep 6Pushed 8mo agoCompare

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

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

Laravel Mint
============

[](#laravel-mint)

Generate realistic test data that actually makes sense.

[![Latest Version](https://camo.githubusercontent.com/920a348ff8e8f798e30cce64d177e786843108093b9a0ced24b91adf2d079517/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617267656e742f6c61726176656c2d6d696e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/argent/laravel-mint)[![Tests](https://github.com/RianMorningstar/laravel-mint/actions/workflows/tests.yml/badge.svg)](https://github.com/RianMorningstar/laravel-mint/actions/workflows/tests.yml)[![MIT License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/5d13a952ae716250c1e2ba2ef0f896663f0dbb45cb44bc05d923f3f1a23b03b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617267656e742f6c61726176656c2d6d696e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/argent/laravel-mint)

 [![PHP 8.2+](https://camo.githubusercontent.com/dca1922ac204bd05280735a65ea710a894f8e1451f227b10c75a394920e24f03/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c75653f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/dca1922ac204bd05280735a65ea710a894f8e1451f227b10c75a394920e24f03/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c75653f7374796c653d666f722d7468652d6261646765) [![Laravel 10.x|11.x|12.x](https://camo.githubusercontent.com/51248ed00dea76f824c3d587343e9dbe1c40c4f4020c08bd3ec792802dac3071/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e782532307c25323031312e782532307c25323031322e782d7265643f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/51248ed00dea76f824c3d587343e9dbe1c40c4f4020c08bd3ec792802dac3071/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e782532307c25323031312e782532307c25323031322e782d7265643f7374796c653d666f722d7468652d6261646765) [![Multi-Database Support](https://camo.githubusercontent.com/9d68642250da52f895a23b9a9e7faab6c56d2dbe8c8d9411b0fe940c45d24768/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44617461626173652d53514c6974652532307c2532304d7953514c2532307c253230506f737467726553514c2d677265656e3f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/9d68642250da52f895a23b9a9e7faab6c56d2dbe8c8d9411b0fe940c45d24768/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44617461626173652d53514c6974652532307c2532304d7953514c2532307c253230506f737467726553514c2d677265656e3f7374796c653d666f722d7468652d6261646765)

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Core Features](#core-features)
    - [Model Analysis](#model-analysis)
    - [Smart Data Generation](#smart-data-generation)
    - [Pattern System](#pattern-system)
    - [Scenarios](#scenarios)
    - [Import &amp; Export](#import--export)
- [Examples](#examples)
- [Configuration](#configuration)
- [API Reference](#api-reference)
- [CLI Commands](#cli-commands)
- [Advanced Usage](#advanced-usage)
- [Testing](#testing)
- [Contributing](#contributing)
- [Support](#support)
- [License](#license)

Introduction
------------

[](#introduction)

Laravel Mint is a powerful data generation package that goes beyond simple random values. It analyzes your models, understands relationships, and generates data that follows real-world patterns. Whether you need test data for development, load testing, or demos, Mint creates datasets that actually make sense.

### Why Laravel Mint?

[](#why-laravel-mint)

Ever generated test data where all users signed up on the same day? Or where order values are completely random instead of following realistic distributions? That's what we fix. Laravel Mint generates data that looks and behaves like production data, making your testing and development more meaningful.

### Key Features

[](#key-features)

- **Smart Model Analysis**: Automatically detects relationships, validations, and data types
- **Real-World Patterns**: Uses statistical distributions and temporal patterns for realistic data
- **Pre-Built Scenarios**: Ready-to-use e-commerce and SaaS data scenarios
- **High Performance**: Stream processing and parallel generation for large datasets
- **Import/Export**: Work with CSV, JSON, Excel, and SQL files
- **API &amp; Webhooks**: RESTful API with CI/CD integration support
- **Factory Integration**: Enhance Laravel factories with pattern support

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

[](#installation)

You can install the package via composer:

```
composer require argent/laravel-mint
```

The package will automatically register its service provider and facade.

### Requirements

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.0 or higher
- Optional: `league/csv` for CSV operations
- Optional: `phpoffice/phpspreadsheet` for Excel support

### Publishing Assets

[](#publishing-assets)

Publish the config file:

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

Publish pattern templates:

```
php artisan vendor:publish --tag=mint-patterns
```

Quick Start
-----------

[](#quick-start)

Here's the fastest way to see what Laravel Mint can do:

```
use LaravelMint\Mint;

// Generate 100 users with realistic patterns
app('mint')->generate(User::class, 100);

// Run a complete e-commerce scenario
php artisan mint:scenario ecommerce
```

That's it! You now have users with varied registration dates, realistic email patterns, and proper timestamps. But we're just getting started.

Core Features
-------------

[](#core-features)

### Model Analysis

[](#model-analysis)

Laravel Mint starts by understanding your models. It examines relationships, validation rules, database schemas, and more:

```
use LaravelMint\Mint;

$mint = app('mint');

// Analyze a model
$analysis = $mint->analyze(User::class);

// See what Mint discovered
print_r($analysis);
// Returns: fillable fields, relationships, validation rules, column types, etc.
```

The analyzer detects:

- Foreign keys and relationships (belongsTo, hasMany, etc.)
- Validation rules from FormRequests
- Database column types and constraints
- Model scopes and accessors
- Enum fields and their valid values

### Smart Data Generation

[](#smart-data-generation)

Mint doesn't just generate random data. It understands context:

```
// Basic generation with smart defaults
$mint->generate(Product::class, 50);

// This automatically:
// - Sets appropriate prices (not random numbers)
// - Creates realistic SKUs
// - Assigns proper categories
// - Generates SEO-friendly slugs
// - Sets stock levels that make sense
```

#### Customizing Generation

[](#customizing-generation)

```
$mint->generate(User::class, 100, [
    'overrides' => [
        'country' => 'USA',
        'is_active' => true,
    ],
    'with_relations' => ['posts', 'comments'],
    'use_patterns' => true,
]);
```

### Pattern System

[](#pattern-system)

Real data follows patterns. Laravel Mint includes several statistical distributions to make your test data realistic:

#### Normal Distribution (Bell Curve)

[](#normal-distribution-bell-curve)

Perfect for natural phenomena like heights, weights, or test scores:

```
use LaravelMint\Patterns\Distributions\NormalDistribution;

$pattern = new NormalDistribution(mean: 30, stddev: 5);

// Generate ages centered around 30
$mint->generate(User::class, 1000, [
    'column_patterns' => [
        'age' => $pattern
    ]
]);
```

#### Pareto Distribution (80/20 Rule)

[](#pareto-distribution-8020-rule)

Great for modeling real-world scenarios where a few items dominate:

```
use LaravelMint\Patterns\Distributions\ParetoDistribution;

// 80% of revenue from 20% of customers
$pattern = new ParetoDistribution(xmin: 10, alpha: 1.2);

$mint->generate(Order::class, 1000, [
    'column_patterns' => [
        'total_amount' => $pattern
    ]
]);
```

#### Temporal Patterns

[](#temporal-patterns)

Generate time-based data that looks real:

```
use LaravelMint\Patterns\Temporal\LinearGrowth;
use LaravelMint\Patterns\Temporal\SeasonalPattern;

// Linear growth over time (like user signups)
$growth = new LinearGrowth(
    start: now()->subYear(),
    end: now(),
    growth_rate: 0.1
);

// Seasonal patterns (like e-commerce sales)
$seasonal = new SeasonalPattern(
    base_value: 1000,
    amplitude: 0.3,
    peaks: ['november', 'december'] // Black Friday & holidays
);

$mint->generate(Order::class, 5000, [
    'column_patterns' => [
        'created_at' => $growth,
        'daily_revenue' => $seasonal
    ]
]);
```

### Scenarios

[](#scenarios)

Scenarios are pre-built data generation templates for common use cases:

#### E-commerce Scenario

[](#e-commerce-scenario)

```
// Generate a complete e-commerce dataset
php artisan mint:scenario ecommerce --users=1000 --products=500 --orders=5000

// Or use in code
use LaravelMint\Scenarios\ScenarioRunner;
use LaravelMint\Scenarios\Presets\EcommerceScenario;

$runner = app(ScenarioRunner::class);
$runner->register('ecommerce', EcommerceScenario::class);

$result = $runner->run('ecommerce', [
    'user_count' => 1000,
    'product_count' => 500,
    'order_count' => 5000,
    'seasonal_pattern' => true,
    'black_friday' => true,
]);
```

This generates:

- Users segmented into power buyers (20%), regular (50%), and occasional (30%)
- Products with realistic pricing following market distributions
- Orders with seasonal patterns and Black Friday spikes
- Cart abandonment data
- Product reviews with realistic ratings
- Wishlists and customer behavior data

#### SaaS Scenario

[](#saas-scenario)

```
php artisan mint:scenario saas --organizations=100

// Generates:
// - Organizations with growth patterns
// - Subscription lifecycles with realistic churn
// - Team hierarchies
// - Usage metrics and billing data
// - API keys and audit logs
```

### Import &amp; Export

[](#import--export)

Work with existing data or share your generated datasets:

#### Importing Data

[](#importing-data)

```
use LaravelMint\Import\ImportManager;

$importer = new ImportManager();

// Map CSV columns to model fields
$importer->mapping(User::class, [
    'name' => 'full_name',        // CSV column -> Model field
    'email' => 'email_address',
    'password' => function ($row) {
        return bcrypt($row['password']);
    }
]);

// Import with validation
$result = $importer->import('users.csv');
```

#### Exporting Data

[](#exporting-data)

```
use LaravelMint\Export\ExportManager;

$exporter = new ExportManager();

// Export specific models and fields
$exporter->model(User::class, ['id', 'name', 'email', 'created_at'])
         ->model(Order::class)
         ->where(Order::class, 'status', 'completed')
         ->compress();

$result = $exporter->export('json', 'exports/backup.json');
```

Examples
--------

[](#examples)

### Example 1: Realistic User Registration Pattern

[](#example-1-realistic-user-registration-pattern)

You want users that signed up over the past year with a growth trend:

```
use LaravelMint\Mint;
use LaravelMint\Patterns\Temporal\LinearGrowth;

$mint = app('mint');

// Create a growth pattern
$registrationPattern = new LinearGrowth(
    start: now()->subYear(),
    end: now(),
    growth_rate: 0.15  // 15% monthly growth
);

// Generate users
$mint->generate(User::class, 1000, [
    'column_patterns' => [
        'created_at' => $registrationPattern,
        'email_verified_at' => function ($user) {
            // 80% verify within 24 hours
            if (rand(1, 100) created_at->addHours(rand(1, 24));
            }
            return null;
        }
    ]
]);
```

### Example 2: E-commerce with Realistic Order Values

[](#example-2-e-commerce-with-realistic-order-values)

```
// Most orders are small, few are large (Pareto principle)
use LaravelMint\Patterns\Distributions\ParetoDistribution;

$orderValues = new ParetoDistribution(xmin: 25, alpha: 1.5);

// Generate orders
$mint->generate(Order::class, 1000, [
    'column_patterns' => [
        'subtotal' => $orderValues,
        'tax' => function ($order) {
            return $order->subtotal * 0.08; // 8% tax
        },
        'total' => function ($order) {
            return $order->subtotal + $order->tax;
        }
    ]
]);
```

### Example 3: Building a Test Dataset for Load Testing

[](#example-3-building-a-test-dataset-for-load-testing)

```
// Use streaming for large datasets
use LaravelMint\Performance\StreamProcessor;

$processor = new StreamProcessor();

// Generate 1 million records without memory issues
$processor->generate(User::class, 1000000, function ($index) {
    return [
        'name' => "User {$index}",
        'email' => "user{$index}@example.com",
        'created_at' => now()->subDays(rand(0, 365)),
    ];
}, [
    'chunk_size' => 5000,
    'batch_insert' => true
]);
```

### Example 4: Creating Linked Data with Relationships

[](#example-4-creating-linked-data-with-relationships)

```
// Generate a complete blog dataset
$mint->generate(User::class, 10, [
    'after_create' => function ($user) use ($mint) {
        // Each user gets 5-15 posts
        $postCount = rand(5, 15);
        $mint->generate(Post::class, $postCount, [
            'overrides' => [
                'user_id' => $user->id,
                'published_at' => function () use ($user) {
                    // Posts published after user joined
                    return fake()->dateTimeBetween(
                        $user->created_at,
                        'now'
                    );
                }
            ],
            'after_create' => function ($post) use ($mint) {
                // Each post gets 0-20 comments
                $commentCount = rand(0, 20);
                $mint->generate(Comment::class, $commentCount, [
                    'overrides' => [
                        'post_id' => $post->id,
                        'user_id' => User::inRandomOrder()->first()->id,
                    ]
                ]);
            }
        ]);
    }
]);
```

### Example 5: Custom Scenario for Your Domain

[](#example-5-custom-scenario-for-your-domain)

```
use LaravelMint\Scenarios\BaseScenario;

class RealEstateScenario extends BaseScenario
{
    protected function initialize(): void
    {
        $this->name = 'Real Estate Platform';
        $this->description = 'Generate property listings and inquiries';

        $this->requiredModels = [
            Property::class,
            Agent::class,
            Inquiry::class,
        ];
    }

    protected function execute(): void
    {
        // Generate agents
        $this->generateModel(Agent::class, 50, [
            'column_patterns' => [
                'years_experience' => new NormalDistribution(7, 3),
                'commission_rate' => new NormalDistribution(0.025, 0.005),
            ]
        ]);

        // Generate properties with realistic pricing
        $this->generateModel(Property::class, 500, [
            'column_patterns' => [
                'price' => new ParetoDistribution(200000, 1.5),
                'bedrooms' => new PoissonDistribution(3),
                'square_feet' => new NormalDistribution(1800, 500),
            ]
        ]);

        // Generate inquiries with temporal patterns
        $this->generateModel(Inquiry::class, 2000, [
            'column_patterns' => [
                'created_at' => new SeasonalPattern(
                    base_value: 50,
                    peaks: ['march', 'april', 'september'] // Peak seasons
                ),
            ]
        ]);
    }
}
```

### Example 6: API Integration

[](#example-6-api-integration)

```
// Using the REST API for remote generation
$response = Http::withHeaders([
    'X-Mint-Api-Key' => 'your-api-key'
])->post('https://your-app.com/api/mint/generate', [
    'model' => 'App\Models\User',
    'count' => 100,
    'options' => [
        'use_patterns' => true
    ]
]);

// Async generation for large datasets
$response = Http::post('https://your-app.com/api/mint/generate', [
    'model' => 'App\Models\Product',
    'count' => 10000,
    'async' => true,
    'webhook_url' => 'https://your-app.com/webhooks/generation-complete'
]);

$jobId = $response->json('job_id');
```

### Example 7: CI/CD Integration

[](#example-7-cicd-integration)

```
# .github/workflows/test.yml
name: Tests
on: [push]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Generate Test Data
        run: |
          php artisan mint:scenario ecommerce --users=100
          php artisan test
```

### Example 8: Seeder Generation

[](#example-8-seeder-generation)

```
// Generate a seeder from existing data
php artisan mint:seed --generate --model=User

// Creates: database/seeders/UserSeeder.php
```

### Example 9: Factory Enhancement

[](#example-9-factory-enhancement)

```
use LaravelMint\Integration\FactoryIntegration;

$factory = app(FactoryIntegration::class);

// Enhance your existing factory with patterns
User::factory()
    ->count(100)
    ->state($factory->createState('premium', [
        'subscription_ends_at' => [
            'pattern' => 'temporal',
            'start' => now(),
            'end' => now()->addYear(),
        ],
        'lifetime_value' => [
            'pattern' => 'pareto',
            'xmin' => 100,
            'alpha' => 1.2,
        ]
    ]))
    ->create();
```

### Example 10: Memory-Efficient Processing

[](#example-10-memory-efficient-processing)

```
use LaravelMint\Performance\StreamProcessor;
use LaravelMint\Performance\MemoryMonitor;

$monitor = new MemoryMonitor();
$processor = new StreamProcessor();

// Monitor memory while generating
$monitor->start('large_generation');

$processor->stream(User::class, function ($user) {
    // Process each user without loading all into memory
    $user->orders()->create([
        'total' => rand(10, 1000)
    ]);
}, [
    'chunk_size' => 100,
    'use_cursor' => true  // Most memory efficient
]);

$metrics = $monitor->stop('large_generation');
echo "Peak memory: " . $metrics->getPeakMemory();
```

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

[](#configuration)

After publishing the config file, you can customize Mint's behavior:

```
// config/mint.php
return [
    'default_count' => 10,
    'chunk_size' => 1000,

    'patterns' => [
        'enabled' => true,
        'cache_ttl' => 3600,
    ],

    'scenarios' => [
        'path' => app_path('Scenarios'),
        'namespace' => 'App\\Scenarios',
    ],

    'api' => [
        'enabled' => true,
        'prefix' => 'api/mint',
        'middleware' => ['api', 'throttle:60,1'],
        'keys' => env('MINT_API_KEYS', ''),
    ],

    'webhooks' => [
        'timeout' => 30,
        'retries' => 3,
    ],

    'performance' => [
        'parallel_workers' => 4,
        'memory_limit' => '256M',
        'use_transactions' => true,
    ],
];
```

API Reference
-------------

[](#api-reference)

### Authentication

[](#authentication)

All API endpoints require authentication via API key:

```
curl -H "X-Mint-Api-Key: your-key" https://your-app.com/api/mint/models
```

### Endpoints

[](#endpoints)

#### Generate Data

[](#generate-data)

```
POST /api/mint/generate
Content-Type: application/json

{
    "model": "App\\Models\\User",
    "count": 100,
    "options": {
        "use_patterns": true
    }
}
```

#### Import Data

[](#import-data)

```
POST /api/mint/import
Content-Type: multipart/form-data

file: users.csv
mappings[User][name]: full_name
mappings[User][email]: email
```

#### Export Data

[](#export-data)

```
POST /api/mint/export
Content-Type: application/json

{
    "models": ["App\\Models\\User"],
    "format": "json",
    "compress": true
}
```

#### List Available Models

[](#list-available-models)

```
GET /api/mint/models
```

#### Run Scenario

[](#run-scenario)

```
POST /api/mint/scenarios/run
Content-Type: application/json

{
    "scenario": "ecommerce",
    "options": {
        "user_count": 1000
    }
}
```

CLI Commands
------------

[](#cli-commands)

Laravel Mint provides several Artisan commands:

### Generate Command

[](#generate-command)

```
# Basic generation
php artisan mint:generate User 100

# With options
php artisan mint:generate Product 50 --pattern --with-relations

# Using specific patterns
php artisan mint:generate Order 1000 --pattern=pareto --pattern-config=xmin:10,alpha:1.5
```

### Analyze Command

[](#analyze-command)

```
# Analyze a model
php artisan mint:analyze User

# Analyze with relationships
php artisan mint:analyze Post --with-relations
```

### Scenario Command

[](#scenario-command)

```
# List available scenarios
php artisan mint:scenario:list

# Run a scenario
php artisan mint:scenario ecommerce

# Dry run to see what would be generated
php artisan mint:scenario saas --dry-run

# With custom options
php artisan mint:scenario ecommerce --config=user_count:500 --config=seasonal_pattern:false
```

### Import Command

[](#import-command)

```
# Import CSV
php artisan mint:import users.csv --model=User

# With field mapping
php artisan mint:import data.csv --model=Product --mapping=name:product_name

# Skip validation
php artisan mint:import large.json --no-validation
```

### Export Command

[](#export-command)

```
# Export to JSON
php artisan mint:export json --model=User --model=Post

# Export with conditions
php artisan mint:export csv --model=Order --where=Order:status:completed

# Compressed export
php artisan mint:export sql --model=User --compress
```

### Seed Command

[](#seed-command)

```
# Generate seeder files
php artisan mint:seed --generate --model=User

# Smart seeder with dependencies
php artisan mint:seed --smart --model=User --model=Post --model=Comment

# Seed for specific environment
php artisan mint:seed --environment=testing
```

Advanced Usage
--------------

[](#advanced-usage)

### Custom Pattern Creation

[](#custom-pattern-creation)

Create your own patterns for domain-specific data:

```
use LaravelMint\Patterns\AbstractPattern;

class PricePattern extends AbstractPattern
{
    public function generate(): float
    {
        // Psychological pricing (ending in 9)
        $base = rand(10, 100);
        return $base - 0.01;
    }
}

// Register and use
$mint->registerPattern('psychological_price', PricePattern::class);
```

### Parallel Processing

[](#parallel-processing)

For massive datasets, use parallel processing:

```
use LaravelMint\Performance\ParallelProcessor;

$processor = new ParallelProcessor();
$processor->setWorkers(8); // Use 8 parallel workers

$processor->generate(User::class, 100000, function ($index) {
    return [
        'email' => "user{$index}@example.com",
        'name' => "User {$index}",
    ];
});
```

### Query Optimization

[](#query-optimization)

Prevent N+1 queries when generating related data:

```
use LaravelMint\Performance\QueryOptimizer;

$optimizer = new QueryOptimizer();

$optimizer->profile(function () use ($mint) {
    $mint->generate(Post::class, 100, [
        'with_relations' => ['user', 'comments', 'tags']
    ]);
});

// See optimization suggestions
$suggestions = $optimizer->getSuggestions();
```

### Caching for Performance

[](#caching-for-performance)

Cache generated patterns for reuse:

```
use LaravelMint\Performance\CacheManager;

$cache = new CacheManager();

// Cache pattern results
$cache->remember('user_ages', function () {
    return (new NormalDistribution(35, 10))->generateMany(1000);
}, 3600);
```

Testing
-------

[](#testing)

Laravel Mint makes testing easier with realistic data:

### In PHPUnit Tests

[](#in-phpunit-tests)

```
use LaravelMint\Mint;

class OrderTest extends TestCase
{
    public function test_order_processing()
    {
        $mint = app('mint');

        // Generate test data
        $mint->generate(User::class, 1);
        $mint->generate(Product::class, 5);
        $mint->generate(Order::class, 1, [
            'overrides' => [
                'status' => 'pending'
            ]
        ]);

        // Run your test
        $order = Order::first();
        $this->assertTrue($order->process());
    }
}
```

### In Pest Tests

[](#in-pest-tests)

```
use LaravelMint\Mint;

beforeEach(function () {
    $this->mint = app('mint');
});

it('calculates order totals correctly', function () {
    $this->mint->generate(Order::class, 10, [
        'column_patterns' => [
            'subtotal' => new NormalDistribution(100, 20)
        ]
    ]);

    $orders = Order::all();

    $orders->each(function ($order) {
        expect($order->total)->toBe($order->subtotal + $order->tax);
    });
});
```

### Load Testing

[](#load-testing)

```
use LaravelMint\Performance\Benchmark;

$benchmark = new Benchmark();

$results = $benchmark->loadTest(function () {
    // Simulate user behavior
    $user = User::factory()->create();
    $user->orders()->create([
        'total' => rand(10, 500)
    ]);
}, [
    'duration' => 60,        // Run for 60 seconds
    'concurrency' => 100,    // 100 concurrent operations
]);

echo "Throughput: " . $results->getThroughput() . " ops/sec";
```

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

[](#contributing)

We love contributions! Here's how to get started:

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Write tests for your changes
4. Make your changes
5. Run the test suite (`composer test`)
6. Format your code (`composer format`)
7. Commit your changes (`git commit -m 'Add amazing feature'`)
8. Push to your branch (`git push origin feature/amazing-feature`)
9. Open a Pull Request

### Development Setup

[](#development-setup)

```
# Clone your fork
git clone https://github.com/your-username/laravel-mint.git
cd laravel-mint

# Install dependencies
composer install

# Run tests
composer test

# Format code
composer format
```

### Coding Standards

[](#coding-standards)

We follow PSR-12 coding standards and use Laravel Pint for formatting. Before submitting a PR, please run:

```
composer format
```

Support
-------

[](#support)

### Documentation

[](#documentation)

For more detailed documentation, visit our [documentation site](https://laravel-mint.dev/docs).

### Getting Help

[](#getting-help)

- **Issues**: [GitHub Issues](https://github.com/argent/laravel-mint/issues)
- **Discussions**: [GitHub Discussions](https://github.com/argent/laravel-mint/discussions)
- **Email**:

### Commercial Support

[](#commercial-support)

For commercial support, custom development, or enterprise licenses, contact us at .

Security
--------

[](#security)

If you discover any security issues, please email  instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

Credits
-------

[](#credits)

- [Argent](https://github.com/argent)
- [All Contributors](../../contributors)

Special thanks to the Laravel community for the inspiration and feedback that shaped this package.

License
-------

[](#license)

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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance61

Regular maintenance activity

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~1 days

Total

2

Last Release

247d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/77e2b7b033bb0d8dc6671ad1ea8ff381f31a9a643652e81142a2091bb3ae3332?d=identicon)[RianMorningstar](/maintainers/RianMorningstar)

---

Top Contributors

[![RianMorningstar](https://avatars.githubusercontent.com/u/130930018?v=4)](https://github.com/RianMorningstar "RianMorningstar (8 commits)")[![jdavalenti](https://avatars.githubusercontent.com/u/18230797?v=4)](https://github.com/jdavalenti "jdavalenti (2 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  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)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[zonneplan/laravel-module-loader

Module loader for Laravel

24118.4k](/packages/zonneplan-laravel-module-loader)

PHPackages © 2026

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