I'm a little lost in the functionality of the contracts and extension of them. I have the following shipping driver set up but it always defaults to local-pickup unless I hard code assigning a new carrier after the creation of a new cart. Am I missing something? How can I make sure it it enforces the default dhl of the config value shipping.default
The boot of AppServiceProvider contains the extension of the Shipping facade
use Bazar\Support\Facades\Shipping;
public function boot()
{
Shipping::extend('dhl', function ($app) {
return new DHLDriver();
});
}
The DHLDriver contains the following
<?php
namespace App\Drivers;
use Bazar\Contracts\Shippable;
use Bazar\Shipping\Driver;
class DHLDriver extends Driver
{
public function calculate(Shippable $model): float
{
return 4.5;
}
}
I'm a little lost in the functionality of the contracts and extension of them. I have the following shipping driver set up but it always defaults to local-pickup unless I hard code assigning a new carrier after the creation of a new cart. Am I missing something? How can I make sure it it enforces the default
dhl
of the config valueshipping.default
Config:
Result of the default is:
dhl
The boot of AppServiceProvider contains the extension of the Shipping facade
The DHLDriver contains the following