Contributing to LarAgent

We welcome contributions to LarAgent! Whether it’s improving documentation, fixing bugs, or adding new features, your help is appreciated. This guide will walk you through the process of setting up your development environment and submitting contributions.

Need help in contributing? Join our Discord community, send “@Maintainer 🛠️ onboard me” in any channel and we will help you to get started.

Development Setup

Follow these steps to set up your local development environment:

  1. Fork the repository on GitHub

  2. Clone your fork:

    git clone https://github.com/YOUR_USERNAME/LarAgent.git
    cd LarAgent
    
  3. Install dependencies:

    composer install
    
  4. Create a new branch for your feature or bugfix:

    git checkout -b feature/your-feature-name
    

Coding Guidelines

When contributing to LarAgent, please follow these guidelines to ensure your code meets our standards:

Code Style

  • Use type hints and return types where possible
  • Add PHPDoc blocks for classes and methods
  • Keep methods focused and concise
  • Follow PSR-12 coding standards

LarAgent uses PHP CS Fixer to maintain code style. You can run it with:

composer format

Testing

All new features and bug fixes should include tests. LarAgent uses PEST for testing.

  • Add tests for new features
  • Ensure all tests pass before submitting:
    composer test
    
  • Maintain or improve code coverage

Documentation

Good documentation is crucial for any project:

  • Add PHPDoc blocks for new classes and methods
  • Include examples for new features
  • Consider updating the official documentation for major changes

Commit Guidelines

  • Use clear, descriptive commit messages
  • Reference issues and pull requests in your commits
  • Keep commits focused and atomic

Pull Request Process

Follow these steps to submit your contributions:

  1. Update your fork with the latest changes from main:

    git remote add upstream https://github.com/MaestroError/LarAgent.git
    git fetch upstream
    git rebase upstream/main
    
  2. Push your changes to your fork:

    git push origin feature/your-feature-name
    
  3. Create a Pull Request with:

    • Clear title and description
    • List of changes and impact
    • Any breaking changes highlighted
    • Screenshots/examples if relevant

The maintainers aim to review all pull requests within 2 weeks.

Getting Help

If you need assistance while contributing:

  • Open an issue for bugs or feature requests
  • Join discussions in existing issues
  • Join our Discord community
  • Reach out to maintainers for guidance

Security Vulnerabilities

If you discover a security vulnerability, please review our security policy on how to report it properly.

Running Tests

You can run the test suite with:

composer test

For more specific tests:

# Run a specific test file
./vendor/bin/pest tests/YourTestFile.php

# Run with coverage report
composer test-coverage

Thank you for contributing to LarAgent! Your efforts help make the package better for everyone.