First off, thank you for considering contributing to Laravel EuPago! It's people like you that make this package better for everyone.
This project and everyone participating in it is governed by respect and professionalism. By participating, you are expected to uphold this standard.
Before creating bug reports, please check the existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps which reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed after following the steps
- Explain which behavior you expected to see instead and why
- Include your PHP version, Laravel version, and package version
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a step-by-step description of the suggested enhancement
- Provide specific examples to demonstrate the steps
- Describe the current behavior and explain which behavior you expected to see instead
- Explain why this enhancement would be useful
- Fork the repo and create your branch from
master - If you've added code that should be tested, add tests
- If you've changed APIs, update the documentation
- Ensure the test suite passes
- Make sure your code follows the existing code style
- Issue that pull request!
# Clone your fork
git clone https://github.com/your-username/laravel-eupago.git
cd laravel-eupago
# Install dependencies
composer install
# Run tests
composer test
# Run tests with coverage (minimum 80% required)
composer test:coverage
# Run static analysis
composer analyse- Follow PSR-12 coding standards
- Use type hints for all parameters and return types
- Write meaningful variable and method names
- Add PHPDoc blocks for classes and public methods
- Write Pest PHP tests for all new features
- Maintain minimum 80% code coverage
- Test both success and failure scenarios
- Use factories for model creation in tests
- Mock external API calls (EuPago API)
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
When adding new functionality that warrants event dispatching:
- Create the event class in
src/Events/ - Follow the naming convention:
{Entity}{Action}(e.g.,MBReferenceCreated) - Include all relevant data as public properties
- Document the event in README.md under the Events section
- Dispatch the event at the appropriate point in the code flow
- Write tests to verify the event is dispatched correctly
When creating new Artisan commands:
- Place them in
src/Console/ - Use clear, descriptive command signatures
- Provide helpful command descriptions
- Register commands in
EuPagoServiceProvider - Write feature tests for command functionality
- Document commands in README.md
# Run all tests
composer test
# Run tests with coverage report
composer test:coverage
# Run specific test file
vendor/bin/pest tests/Unit/MB/MBTest.php
# Run tests matching a pattern
vendor/bin/pest --filter=MBReference# Run Larastan
composer analyse
# Run with specific level
vendor/bin/phpstan analyse --level=5- Create a test Laravel application
- Require your local package using a path repository in composer.json:
{ "repositories": [ { "type": "path", "url": "../laravel-eupago" } ], "require": { "digitaldev-lx/laravel-eupago": "@dev" } } - Test your changes in the application context
Releases are managed by package maintainers. The process includes:
- Update version in CHANGELOG.md
- Ensure all tests pass on CI/CD
- Ensure code coverage meets 80% minimum
- Create a GitHub release with tag
- Update Packagist automatically via webhook
Feel free to open an issue for any questions or concerns. We're here to help!
By contributing, you agree that your contributions will be licensed under the MIT License.