Download the PHP package givanov95/laravel-shipping without Composer

On this page you can find all versions of the php package givanov95/laravel-shipping. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-shipping

Laravel Shipping

The delivery contract between a Laravel shop and its delivery methods. A courier, a flat rate or a pickup point is one class behind DeliveryMethod; the shop asks it what the customer has to choose, turns the choice into a Destination and asks for its price. The shop needs no branch, table or form per courier, and a courier package needs nothing of the shop.

0.x: the contract may still change between minor versions until a courier behind it has been checked against its real API.

A delivery method

Method What the shop does with it
key() Keeps it on the order. It is the key the method is registered under.
destinationTypes() Offers the customer address, office and/or locker.
rules($type) Validates the checkout form. The fields are the same for every method: city, postal_code, street, street_number, note, place_id, street_id, point_code, point_name.
destination($type, $choice) Stores the Destination it gets back. $choice is validated with rules(); the shop fills in country_code.
price($destination, $parcel) Charges it. null means the method has no price for this destination. The shop has no exchange rate: a price in another currency than the one of the parcel is refused, not converted.

Destination carries the method, the type, the country code (ISO 3166-1 alpha-2), city, postal code, street, number, note, and the code and name of an office or a locker. Whatever else the courier needs later (the id of a city, of a street) goes in courierData, which only the method reads. toArray() gives the fields in snake_case, ready for a table.

Parcel is what is delivered. Today it tells the currency the customer pays in; the cart of the shop implements it.

Optional contracts

Waybills

Parcel is what is known in the cart, before anything is packed: the currency, to name a price. A Shipment is what is known once the order is packed, and what the courier needs to take it:

Field
reference The number of the order, printed on the waybill.
recipientName, recipientPhone, recipientEmail Who receives it; the email may be null.
weight The total weight in kilograms, above zero.
packages How many packages, at least one.
contents What is inside.
cashOnDelivery A Money the courier collects from the recipient, in its currency, or null.

The destination is the Destination the method built at checkout, as the shop stored it, so whatever the method put in courierData comes back to it. The Waybill carries the number and, when the courier gives them, a trackingUrl for the recipient, a labelUrl to print for the shop and the price the courier charges.

Registering a method

The package binds one DeliveryMethods registry. A package that brings a method adds it from its service provider:

The class is built by the container the first time the method is asked for, so its dependencies are injected and a request that never reaches the checkout pays nothing. The label is what the shop calls the method; the shop translates it.

Registering a method does not offer it. Which methods a customer can pick, and in what order, is the decision of the shop:

get() throws a LogicException when the class says another key() than the one it is registered under: an order would name one method and its delivery another.

Testing

License

MIT


All versions of laravel-shipping with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
brick/money Version ^0.15
illuminate/contracts Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package givanov95/laravel-shipping contains the following files

Loading the files please wait ...