Download the PHP package kalimeromk/postal-tracking without Composer
On this page you can find all versions of the php package kalimeromk/postal-tracking. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package postal-tracking
Postal Tracking Package π¦
Advanced PHP package for tracking postal shipments from Posta na Severna Makedonija with multi-framework support, comprehensive error handling, and high-performance tracking capabilities. Features Laravel integration, Yii framework support, and Native PHP usage with configurable caching, retry mechanisms, and automatic data transformation.
π Table of Contents
- Features
- Installation
- Quick Start
- Framework Integration
- Laravel Setup
- Yii Framework Setup
- Native PHP Setup
- Usage Examples
- API Reference
- Configuration
- Testing
- Development
- Contributing
- License
β¨ Features
- β Track postal shipments from Posta na Severna Makedonija
- π Laravel integration with service provider and facade
- π― Yii framework support with native integration
- π₯ Native PHP support - No framework required!
- π JSON API responses with structured data
- π Automatic data transformation and localization
- π‘οΈ Comprehensive error handling and validation
- β‘ High-performance with configurable timeouts and retries
- π§ Configurable settings via environment variables
- π Comprehensive documentation and examples
- π§ͺ Full test coverage with PHPUnit
- π¦ PSR-4 autoloading and Composer integration
π¦ Installation
Requirements
- PHP 8.1 or higher
- cURL extension
- JSON extension
Install via Composer
Verify Installation
π Quick Start
Basic Usage
With Configuration
π§ Framework Integration
Laravel Setup
The package auto-registers its service provider and facade. No additional configuration required!
Basic Usage
Controller Example
Publish Configuration (Optional)
Service Provider Registration
The package automatically registers itself. If you need manual registration, add to config/app.php:
Yii Framework Setup
Use the service directly in your controllers or components.
Basic Usage
Controller Example
Component Registration
Add to your config/web.php or config/console.php:
Native PHP Setup
No framework required! Perfect for standalone applications, microservices, or CLI tools.
Simple Tracker Class
Web Application
Command Line Usage
π Usage Examples
Advanced Configuration
Batch Processing
Error Handling
π API Reference
PostalTrackingService Class
Constructor
Methods
trackShipment()
Parameters:
$trackingCode(string): The tracking code to look up$options(array): Additional optionstimeout(int): API timeout in secondsretry_attempts(int): Number of retry attemptstransform(bool): Enable/disable data transformation
Returns: array - Tracking data with success status
Configuration Methods
Response Format
Success Response
Error Response
Exception Classes
PostalTrackingException
Base exception class for all postal tracking related errors.
InvalidTrackingCodeException
Thrown when the tracking code format is invalid.
ApiException
Thrown when API communication fails.
βοΈ Configuration
Environment Variables
Create a .env file in your project root:
Programmatic Configuration
Framework-Specific Configuration
Laravel
Publish the config file:
Then edit config/postal-tracking.php:
Yii
Add to your configuration:
π§ͺ Testing
The package includes comprehensive test coverage with PHPUnit.
Run Tests
Test Coverage
- Unit tests for all service methods
- Integration tests with real API calls
- Exception handling tests
- Configuration tests
- Framework integration tests
Example Test
π οΈ Development
Code Style
The package follows PSR-12 coding standards.
Static Analysis
Development Setup
- Clone the repository
- Install dependencies:
composer install - Run tests:
composer test - Fix code style:
composer cs-fix
Contributing Guidelines
- Follow PSR-12 coding standards
- Write tests for new features
- Update documentation
- Ensure all tests pass
- Submit a pull request
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Development Commands
π License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by KalimeroMK
π Support
If you encounter any issues or have questions:
- π§ Email: [email protected]
- π Issues: GitHub Issues
- π Documentation: GitHub Wiki
π Related Projects
- Email Check Package - Advanced PHP email validation library
- Macedonian Postal API - Official postal service API
All versions of postal-tracking with dependencies
ext-json Version *
ext-curl Version *