PHPackages                             cleaniquecoders/uat - 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. cleaniquecoders/uat

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

cleaniquecoders/uat
===================

This package automatically generates comprehensive User Acceptance Testing (UAT) documentation for Laravel applications by analyzing your routes, middleware, policies, and authorization rules. It creates structured test scripts that help QA teams and stakeholders understand what needs to be tested and how to test it.

1.1.0(1mo ago)331[4 PRs](https://github.com/cleaniquecoders/uat/pulls)MITPHPPHP ^8.4CI passing

Since Sep 28Pushed 1mo agoCompare

[ Source](https://github.com/cleaniquecoders/uat)[ Packagist](https://packagist.org/packages/cleaniquecoders/uat)[ Docs](https://github.com/cleaniquecoders/uat)[ GitHub Sponsors]()[ RSS](/packages/cleaniquecoders-uat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (26)Versions (7)Used By (0)

User Acceptance Testing
=======================

[](#user-acceptance-testing)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c18b02a1046865eca8e333e975d3615205f24d4eb0ca52b4cbe8116366deee90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c65616e69717565636f646572732f7561742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cleaniquecoders/uat)[![GitHub Tests Action Status](https://camo.githubusercontent.com/7a8fe748bbfd477f722cd8a3274f07cf0b681aa15f135019687e90a430553018/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c65616e69717565636f646572732f7561742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cleaniquecoders/uat/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/1fed931264076dc7dec252eb68fd69799b14de9b2d38ccf013c9d4cb808ddd25/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c65616e69717565636f646572732f7561742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/cleaniquecoders/uat/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/47ae5d602e7391908f1065d8d0a53df77dc8fef95da002fce89be517aca756af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c65616e69717565636f646572732f7561742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cleaniquecoders/uat)

This package automatically generates comprehensive User Acceptance Testing (UAT) documentation for Laravel applications by analyzing your routes, middleware, policies, and authorization rules. It creates structured test scripts that help QA teams and stakeholders understand what needs to be tested and how to test it.

Features
--------

[](#features)

- **📋 Automatic UAT Script Generation**: Analyzes your Laravel application and generates detailed testing documentation
- **🔐 Authorization Testing**: Identifies middleware, policies, and authorization requirements for each route
- **📊 Multiple Output Formats**: Supports Markdown and JSON output formats
- **🎯 Route Analysis**: Analyzes all application routes and groups them by modules/controllers
- **👥 User Role Documentation**: Generates user role and permission requirements
- **⚙️ Configurable Rules**: Customizable middleware and authorization rule mappings
- **🚫 Smart Filtering**: Excludes development routes and packages from documentation

What It Generates
-----------------

[](#what-it-generates)

The package creates comprehensive UAT documentation including:

1. **Project Information**: Technical stack, environment details, and configuration
2. **User Roles &amp; Permissions**: Required user types and their capabilities
3. **Available Modules**: Organized overview of all testable application modules
4. **Module Test Suites**: Detailed testing scripts for each module including:
    - Route information and HTTP methods
    - Authentication and authorization requirements
    - Step-by-step testing instructions
    - Expected behaviors and validation criteria
    - Prerequisites and setup requirements

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

[](#installation)

You can install the package via composer:

```
composer require cleaniquecoders/uat
```

Publish the configuration file:

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

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

[](#configuration)

The published configuration file (`config/uat.php`) allows you to customize:

- Output directory for generated documentation
- Middleware and authorization rule mappings
- Policy mappings for controllers
- Excluded route prefixes
- Custom service implementations
- Output format configurations

### Example Configuration

[](#example-configuration)

```
return [
    // Output directory for UAT documentation
    'directory' => env('UAT_DIRECTORY', 'uat'),

    // Available output formats
    'formats' => [
        'markdown' => MarkdownGenerator::class,
        'json' => JsonGenerator::class,
    ],

    // Middleware rule mappings
    'rules' => [
        'middleware' => [
            'auth' => [
                'type' => 'authentication',
                'description' => 'User must be logged in',
                'action' => 'Navigate to /login and authenticate',
                'validation' => 'Verify user session is active',
            ],
        ],
        'pattern' => [
            'role:*' => [
                'type' => 'role_authorization',
                'description' => "User must have '{placeholder}' role",
                'action' => "Login with user assigned to '{placeholder}' role",
            ],
        ],
    ],

    // Controller policy mappings
    'policy_mappings' => [
        'UserController' => [
            'policy' => 'UserPolicy',
            'methods' => [
                'index' => [
                    'description' => 'User must have user security view permissions',
                    'permissions' => ['view-user-security'],
                    'roles' => ['superadmin', 'administrator'],
                ],
            ],
        ],
    ],
];
```

Usage
-----

[](#usage)

### Generate UAT Documentation

[](#generate-uat-documentation)

Generate UAT scripts using the Artisan command:

```
# Generate Markdown documentation (default)
php artisan uat:generate

# Generate JSON documentation
php artisan uat:generate --format=json

# Specify custom output directory
php artisan uat:generate --output-dir=/path/to/custom/directory

# Generate with verbose output for debugging
php artisan uat:generate --verbose
```

### Programmatic Usage

[](#programmatic-usage)

You can also generate UAT scripts programmatically:

```
use CleaniqueCoders\Uat\Actions\GenerateUatScript;

// Generate UAT scripts
$result = GenerateUatScript::run(
    outputDir: storage_path('uat-docs'),
    format: 'markdown'
);

// Result contains:
// - directory: Path to generated files
// - generated_files: Array of created file paths
// - date: Generation date
```

### Using the Facade

[](#using-the-facade)

```
use CleaniqueCoders\Uat\Facades\Uat;

// Access UAT services through the facade
$projectInfo = Uat::getProjectInformation();
$modules = Uat::getAvailableModules();
$users = Uat::getUsers();
```

Generated Documentation Structure
---------------------------------

[](#generated-documentation-structure)

When you run the command, it creates a directory structure like this:

```
storage/uat/2024-01-15/
├── 01-project-info.md           # Project overview and technical details
├── 02-users.md                  # User roles and permissions
├── 03-available-modules.md      # Module overview
├── 05-module-dashboard.md       # Dashboard module test suite
├── 06-module-users.md          # Users module test suite
├── 07-module-posts.md          # Posts module test suite
└── ...                         # Additional module test suites

```

### Sample Generated Content

[](#sample-generated-content)

**Project Information:**

- Laravel version, PHP version, database configuration
- Environment details and technical stack
- UAT testing guidelines

**Module Test Suites:**

- Route-by-route testing instructions
- Authentication and authorization requirements
- Step-by-step user actions
- Expected results and validation criteria
- Prerequisites and test data requirements

Extending the Package
---------------------

[](#extending-the-package)

The concept is to extend the core features without modifying the core classes. Current status still requirement study.

At the moment, you may customise the existing core services. See following sections for more details.

### Custom Data Service

[](#custom-data-service)

Implement the `Data` contract to customize data collection:

```
use CleaniqueCoders\Uat\Contracts\Data;

class CustomDataService implements Data
{
    public function getProjectInformation(): array
    {
        // Custom project info logic
    }

    public function getUsers(): Collection
    {
        // Custom user data logic
    }

    public function getAvailableModules(): array
    {
        // Custom module discovery logic
    }
}
```

### Custom Presentation Format

[](#custom-presentation-format)

Implement the `Presentation` contract for custom output formats:

```
use CleaniqueCoders\Uat\Contracts\Presentation;

class CustomPresentationFormat implements Presentation
{
    public function getExtension(): string
    {
        return 'custom';
    }

    public function generateProjectInfo(array $projectInfo): string
    {
        // Custom formatting logic
    }

    // Implement other required methods...
}
```

Integration with CI/CD
----------------------

[](#integration-with-cicd)

You can integrate UAT generation into your deployment pipeline:

```
# GitHub Actions example
- name: Generate UAT Documentation
  run: |
    php artisan uat:generate --format=markdown
    php artisan uat:generate --format=json

- name: Archive UAT Documentation
  uses: actions/upload-artifact@v3
  with:
    name: uat-documentation
    path: storage/uat/
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Nasrul Hazim Bin Mohamad](https://github.com/nasrulhazim)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance98

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.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 ~182 days

Total

2

Last Release

40d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b57069d0f4b634f65eccc6e5d5848990e25968d45ec2cf46d626c6a4658f944b?d=identicon)[nasrulhazim.m](/maintainers/nasrulhazim.m)

---

Top Contributors

[![nasrulhazim](https://avatars.githubusercontent.com/u/10341422?v=4)](https://github.com/nasrulhazim "nasrulhazim (31 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelCleanique Codersuat

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cleaniquecoders-uat/health.svg)

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

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-visit

Quickly visit any route of your Laravel app

15614.6k](/packages/spatie-laravel-visit)[binary-cats/laravel-rbac

Laravel enum-backed RBAC extension of spatie/laravel-permission

7730.4k](/packages/binary-cats-laravel-rbac)[michiruf/laravel-http-automock

Automatically mock http requests when testing

161.0k](/packages/michiruf-laravel-http-automock)[a2insights/filament-saas

Filament Saas for A2Insights

161.1k](/packages/a2insights-filament-saas)

PHPackages © 2026

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