### Install Yalidine Laravel Package Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Uses Composer to download and install the sebbahnouri/yalidine package from the repository. ```bash composer require sebbahnouri/yalidine ``` -------------------------------- ### Configure Composer Minimum Stability Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Sets the minimum stability requirement in the composer.json file to 'dev' to allow installing development versions of packages. ```json "minimum-stability": "dev" ``` -------------------------------- ### Publish Yalidine Configuration File Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Runs the Artisan command to publish the package's configuration file to the application's config directory, allowing customization. ```bash php artisan vendor:publish --tag=Yale-config ``` -------------------------------- ### Configure Yalidine API Credentials Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Adds the required API ID and API Token obtained from the Yalidine website to the application's .env file for authentication. ```bash API_ID=****** API_TOKEN=******* ``` -------------------------------- ### Instantiate Yalidine Service Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Resolves the Sebbahnouri\Yalidine\Yalidine service from the Laravel service container, providing an instance to interact with the API. ```php use Sebbahnouri\Yalidine\Yalidine; $yalidine = app(Yalidine::class); ``` -------------------------------- ### Register Yalidine Service Provider Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Adds the package's service provider to the providers array in the Laravel config/app.php file to enable package functionality. ```php Sebbahnouri\Yalidine\Providers\YaledineServiceProvider::class ``` -------------------------------- ### Create Parcels via Yalidine API Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Sends an array of parcel data to the Yalidine API to create new shipments. Each parcel requires detailed information like recipient details, address, product list, price, dimensions, and shipping options. ```php $parcels = array( // the array that contains all the parcels array ( // first parcel "order_id"=>"MyFirstOrder", "from_wilaya_name"=>"Batna", "firstname"=>"Brahim", "familyname"=>"Mohamed", "contact_phone"=>"0123456789,", "address"=>"Cité Kaidi", "to_commune_name"=>"Bordj El Kiffan", "to_wilaya_name"=>"Alger", "product_list"=>"Presse à café", "price"=>3000, "height"=> 10, "width" => 20, "length" => 30, "weight" => 6, "freeshipping"=> true, "is_stopdesk"=> true, "stopdesk_id" => 163001, "has_exchange"=> 0, "product_to_collect" => null ), array ( // second parcel "order_id" =>"MySecondOrder", "from_wilaya_name"=>"Batna", "firstname"=>"رفيدة", "familyname"=>"بن مهيدي", "contact_phone"=>"0123456789", "address"=>"حي الياسمين", "to_commune_name"=>"Ouled Fayet", "to_wilaya_name"=>"Alger", "product_list"=>"كتب الطبخ", "price"=>2400, "height" => 10, "width" => 20, "length" => 30, "weight" => 6, "freeshipping"=>0, "is_stopdesk"=>0, "has_exchange"=> false ), array ( // third parcel ... ), array( // etc ... ) ); $yalidine->createParcels($parcels) ``` -------------------------------- ### Retrieve Delivery Fees from Yalidine API Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Fetches delivery fee information from the Yalidine API. It can retrieve fees for specific wilaya IDs or retrieve fees for all wilayas. ```php $wilaya_id=['13','14']; $yalidine->retrieveDeliveryfees($wilaya_id); ``` ```php $yalidine->retrieveDeliveryfees(); // or all using ``` -------------------------------- ### Retrieve Parcels from Yalidine API Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Fetches parcel information from the Yalidine API. It can retrieve all parcels or specific parcels by providing an array of tracking numbers. ```php $yalidine->retrieveParcels() // for all the parcels ``` ```php $trackings=['yal-205643','yal-454FU']; $yalidine->retrieveParcels($trackings); ``` -------------------------------- ### Retrieve Parcel Histories Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Fetches parcel history information from the Yalidine API. It can retrieve histories for all statuses or filter by a specific status like 'Livré'. ```php $status=''; // to get all ``` ```php $status='Livré'; $yalidine->deliveredParcels($status) ``` -------------------------------- ### Delete Parcels from Yalidine API Source: https://github.com/sebbahali/yalidine-dz-laravel-api/blob/main/README.md Deletes existing parcels from the Yalidine API by providing an array of their tracking numbers. ```php $trackings=['yal-205643','yal-454FU']; $yalidine->deleteParcels($trackings) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.