ghaninia / shipping
iranian shipping
Installs: 1 640
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 1
Forks: 6
Open Issues: 1
Type:package
Requires
- php: ^8.0|^7.4
- illuminate/database: ^9.16
Requires (Dev)
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-03-05 14:10:24 UTC
README

Calculate postage in Iran
Installation
Go to the project root folder and run the following command
composer require ghaninia/shipping
If you want to make sure the system is correct, Run tests🐱🚀
vendor\bin\phpunit
✔If you use package on laravel you should add below command to app.php
### config/app.php <?php .... 'providers' => [ ... GhaniniaIR\Shipping\ShippingServiceProvider::class, ### ✔ ],
Receive information of cities and provinces and their details
<?php use GhaniniaIR\Shipping\Core\Services\LocationService ; ### Get information on cities and provinces (new LocationService())->list(); ### Are the provinces adjacent to each other? (new LocationService()) ->source(State $state , City $city) ->destination(State $state , ?City $city) ->provincesNeighbors() ; ### Status of origin and destination together (new LocationService()) ->source(State $state , City $city) ->destination(State $state , ?City $city) ->situationStatesTogether() ;
Calculate Post Pishtaz Tariff
<?php use GhaniniaIR\Shipping\Drivers\PishtazDriver; use GhaniniaIR\Shipping\Models\State ; use GhaniniaIR\Shipping\Models\City ; $result = (new PishtazDriver()) ->weight(int $productWeight) ->cost(int $productCost) ->source(State $sourceState , City $sourceCity) ->destination(State $sourceState , ?City $sourceCity) ->calculate();
Calculate Post Sefareshi Tariff
<?php use GhaniniaIR\Shipping\Drivers\SefarshiDriver; use GhaniniaIR\Shipping\Models\State ; use GhaniniaIR\Shipping\Models\City ; $result = (new SefarshiDriver()) ->weight(int $productWeight) ->cost(int $productCost) ->source(State $sourceState , City $sourceCity) ->destination(State $sourceState , ?City $sourceCity) ->calculate();
Reconnection
If you want to change the type of connection to the database, follow the code below
Laravel:
php artisan vendor:publish --tag=shipping --force
It will then be published to you in the database and configuration file