Contributions are welcome and are accepted via pull requests. Please review these guidelines before submitting any pull requests.
- Fork the project.
- Create a new branch.
- Code, test, commit, and push.
- Open a pull request detailing your changes. Make sure to follow the template.
- Please ensure the coding style by running
composer lint. - Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
- You may need to rebase to avoid merge conflicts.
- Please remember that we follow SemVer.
git clone https://github.com/laravel/agent-detector.git agent-detector
cd agent-detector
composer installLint your code:
composer lintRun all tests:
composer testCheck types:
composer test:typesUnit tests:
composer test:unitTo add detection for a new agent:
- Add a new case to the
KnownAgentenum insrc/KnownAgent.php. - Add the detection logic (env var check or file check) in
AgentDetector::detect()insrc/AgentDetector.php— order matters, earlier checks take priority. - Add tests in
tests/AgentDetectorTest.php.