Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4 #8

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

v4 #8

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1]
laravel: [9.*]
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*]
dependency-version: [prefer-stable]
exclude:
- laravel: 11.*
php: 8.1
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"defects":[],"times":{"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_manager_from_config":0.1,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_load_facade":0.012,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#session":0.164,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#cache":0.022,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#eloquent":0.209,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_generate_cart_items_ids_consistently":0.143,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#session":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#cache":0.011,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#eloquent":0.164,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#session":0.019,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#cache":0.011,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#eloquent":0.012,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#session":0.012,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#cache":0.011,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#eloquent":0.014,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#session":0.148,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#cache":0.011,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#eloquent":0.014,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#session":0.047,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#cache":0.011,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#eloquent":0.015,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#session":0.069,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#cache":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#eloquent":0.014,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#session":0.011,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#cache":0.011,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#eloquent":0.013,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#session":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#cache":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#eloquent":0.012,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#session":0.122,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#cache":0.014,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#eloquent":0.022,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart_storing_in_db":0.014,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::user_add_to_cart_storing_in_db":0.05,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::cart_stored_storing_in_db_for_different_users":0.016,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_discount_to_cart_storing_in_db":0.013,"Weble\\LaravelEcommerce\\Tests\\Cart\\MultipleCartsTest::stores_different_carts_in_db":0.015,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_storing_in_db":0.041,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_for_user_storing_in_db":0.015,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_for_user_storing_in_db_multiple_times":0.012,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::can_create_order_from_cart":0.067,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_has_unique_hash":0.022,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_items_are_stored_correctly":0.064,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::uses_state_machine_to_manage_order":0.155,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_history_is_stored_correctly":0.019,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_creates_payment":0.042,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_get_tax_resolver":0.013,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_get_tax_manager":0.01,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_calculate_tax_for_physical_product":0.032,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_calculate_tax_for_physical_product_with_different_country_eu_private_customer":0.01,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_calculate_tax_for_physical_product_with_different_country_eu_company":0.01}}
{"version":1,"defects":{"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_generate_cart_items_ids_consistently":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#session":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#cache":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#eloquent":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart_storing_in_db":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::user_add_to_cart_storing_in_db":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::cart_stored_storing_in_db_for_different_users":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_discount_to_cart_storing_in_db":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\MultipleCartsTest::stores_different_carts_in_db":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_storing_in_db":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_for_user_storing_in_db":8,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_for_user_storing_in_db_multiple_times":8,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::can_create_order_from_cart":8,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_has_unique_hash":8,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_items_are_stored_correctly":8,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::uses_state_machine_to_manage_order":8,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_history_is_stored_correctly":8,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_creates_payment":8,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_calculate_tax_for_physical_product_with_different_country_eu_company":8},"times":{"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_manager_from_config":0.014,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_load_facade":0.007,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#session":0.021,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#cache":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_get_cart_instances#eloquent":0.016,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_generate_cart_items_ids_consistently":0.038,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#session":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#cache":0.007,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart#eloquent":0.013,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#session":0.007,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#cache":0.007,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_check_if_item_is_in_cart#eloquent":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#session":0.007,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#cache":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_remove_from_cart#eloquent":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#session":0.016,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#cache":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_total#eloquent":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#session":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#cache":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_tax#eloquent":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#session":0.011,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#cache":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_item_discounts#eloquent":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#session":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#cache":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_subtotal_discounts#eloquent":0.009,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#session":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#cache":0.008,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_calculate_items_discounts#eloquent":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#session":0.017,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#cache":0.009,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_attach_customer_to_cart#eloquent":0.012,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_to_cart_storing_in_db":0.009,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::user_add_to_cart_storing_in_db":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::cart_stored_storing_in_db_for_different_users":0.012,"Weble\\LaravelEcommerce\\Tests\\Cart\\CartTest::can_add_discount_to_cart_storing_in_db":0.009,"Weble\\LaravelEcommerce\\Tests\\Cart\\MultipleCartsTest::stores_different_carts_in_db":0.01,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_storing_in_db":0.012,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_for_user_storing_in_db":0.009,"Weble\\LaravelEcommerce\\Tests\\Cart\\CustomerTest::can_add_to_cart_for_user_storing_in_db_multiple_times":0.01,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::can_create_order_from_cart":0.016,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_has_unique_hash":0.011,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_items_are_stored_correctly":0.014,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::uses_state_machine_to_manage_order":0.023,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_history_is_stored_correctly":0.016,"Weble\\LaravelEcommerce\\Tests\\Order\\OrderTest::order_creates_payment":0.013,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_get_tax_resolver":0.007,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_get_tax_manager":0.007,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_calculate_tax_for_physical_product":0.009,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_calculate_tax_for_physical_product_with_different_country_eu_private_customer":0.007,"Weble\\LaravelEcommerce\\Tests\\Tax\\TaxTest::can_calculate_tax_for_physical_product_with_different_country_eu_company":0.007}}
8 changes: 8 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# UPGRADE

## 3.x to 4.x

- Dropped support for laravel < 10
- Upgraded to latest version of dependencies (ie: Laravel Money, etc)
- Dropped Spatie Data Transfer in favor of Laravel Data
- Dropped PHPunit < 10
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@
"require": {
"php": "^8.1",
"ext-json": "*",
"cknow/laravel-money": "^6.2 || ^7.1",
"commerceguys/addressing": "^1.0",
"cknow/laravel-money": "^7.1 || ^v8.1",
"commerceguys/addressing": "^1.4",
"commerceguys/tax": "^0.8",
"florianv/laravel-swap": "^2.3",
"iben12/laravel-statable": "^1.4",
"illuminate/database": "^9.0 || ^10.0",
"illuminate/database": "^10.0 || ^11.0",
"mpociot/vat-calculator": "^3.0",
"nyholm/psr7": "^1.3",
"php-http/curl-client": "^2.1",
"php-http/message": "^1.9",
"spatie/data-transfer-object": "^3.7"
"spatie/laravel-data": "^4.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.7",
"orchestra/testbench": "^7.1 || ^8.0",
"phpunit/phpunit": "^9.1 || ^10.0"
"orchestra/testbench": "^8.0 || ^9.1",
"phpunit/phpunit": "^10.0 || ^11.1",
"rector/rector": "^1.1"
},
"autoload": {
"files": [
Expand Down
17 changes: 6 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
Expand All @@ -18,4 +8,9 @@
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
19 changes: 19 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;

return RectorConfig::configure()
->withPaths([
__DIR__ . '/config',
__DIR__ . '/src',
__DIR__ . '/tests',
])
// uncomment to reach your current PHP version
// ->withPhpSets()
->withSets([
PHPUnitSetList::PHPUNIT_100
]);
40 changes: 15 additions & 25 deletions src/Address/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,25 @@
use CommerceGuys\Addressing\Country\Country;
use CommerceGuys\Addressing\Country\CountryRepositoryInterface;
use Illuminate\Http\Request;
use Spatie\DataTransferObject\DataTransferObject;
use Spatie\LaravelData\Data;

class Address extends DataTransferObject implements AddressInterface
class Address extends Data implements AddressInterface
{
public string $name = '';
public string $surname = '';
public string $company = '';
public string $vatId = '';
public string $personalId = '';
public string $country;
public string $street = '';
public string $zip = '';
public string $state = '';
public string $city = '';
public AddressType $type;

public function __construct(array $parameters = [])
public function __construct(
public string $name = '',
public string $surname = '',
public string $company = '',
public string $vatId = '',
public string $personalId = '',
public string $country = 'IT',
public string $street = '',
public string $zip = '',
public string $state = '',
public string $city = '',
public AddressType $type = AddressType::Shipping,
)
{
$parameters['country'] ??= config('ecommerce.store.address.country', 'IT');

$type = $parameters['type'] ?? AddressType::Shipping;

if (! $type instanceof AddressType) {
$type = AddressType::from($type);
}

$parameters['type'] = $type;

parent::__construct($parameters);
}

public function country(): Country
Expand Down
Loading
Loading