We Welcome Contributions
Thank you for considering contributing to Laravel Permission! This package is open source and we love to receive contributions from the community.Ways to Contribute
There are many ways to contribute to this project:Report Bugs
Found a bug? Let us know by creating an issue on GitHub.
Suggest Features
Have an idea for improvement? We’d love to hear it.
Improve Documentation
Help make the docs better for everyone.
Submit Code
Fix bugs or implement new features with pull requests.
Reporting Issues
Before Creating an Issue
Search existing issues
Check if your issue has already been reported in the GitHub Issues.
Check the documentation
Review the documentation and troubleshooting guide to see if your question is already answered.
Creating a Good Issue Report
When creating an issue, please include:Contributing Code
Development Setup
Fork the repository
Fork the laravel-permission repository to your GitHub account.
Coding Standards
This package follows the PSR-12 coding standard and uses Laravel Pint for code formatting. Before committing, format your code:Code that doesn’t follow the style guidelines will not be accepted.
Writing Tests
All new features and bug fixes must include tests. This package uses Pest for testing. Run the test suite:Example Test Structure
Example Test Structure
Submitting a Pull Request
Commit your changes
Write clear, descriptive commit messages:Follow conventional commit format when possible:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test additions/changesrefactor:for code refactoring
Create pull request
Go to the original repository and create a pull request from your fork.Include in your PR description:
- What changes you made
- Why you made them
- Any relevant issue numbers (e.g., “Fixes #123”)
- Screenshots if applicable (for UI changes)
Pull Request Guidelines
Before Submitting
Before Submitting
- Ensure your code follows PSR-12 standards
- Run
./vendor/bin/pintto format code - All tests must pass
- Add tests for new functionality
- Update documentation if needed
- Keep pull requests focused on a single concern
- Rebase your branch if needed to keep history clean
PR Review Process
PR Review Process
- Automated checks will run (tests, code style)
- Maintainers will review your code
- Address feedback if requested
- Merge once approved
Maintainers may request changes or provide suggestions. This is normal and helps maintain code quality.
Improving Documentation
Documentation improvements are always welcome!Documentation Location
The documentation source files are in the/docs directory of the repository.
Documentation Guidelines
- Use clear, simple language
- Include code examples
- Test all code examples
- Add navigation entries if creating new pages
- Use proper markdown formatting
- Include relevant links to related topics
- Edit the markdown files in
/docs - Submit a pull request
- Tag it with the
documentationlabel
Community Guidelines
When participating in discussions:- Be respectful and constructive
- Stay on topic
- Help others when you can
- Follow the Code of Conduct
Recognition
Contributors are recognized in:- The CHANGELOG
- GitHub Contributors page
- Release notes for significant contributions
Development Resources
GitHub Repository
View source code and contribute
Issue Tracker
Report bugs or request features
Pull Requests
View open pull requests
Discussions
Ask questions and share ideas
Questions?
If you have questions about contributing:- Check the documentation
- Search existing issues
- Start a discussion
- Ask in the Spatie Discord
Support Spatie
Spatie invests significant resources in creating and maintaining open source packages. You can support their work by:- Buying a paid product
- Becoming a sponsor
- Sending a postcard to: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium
All postcards received are published on Spatie’s virtual postcard wall.
License
By contributing, you agree that your contributions will be licensed under the MIT License.Thank you for contributing to Laravel Permission! Your efforts help make this package better for everyone.