Skip to content

Commit 28c44ce

Browse files
committed
allow multiline in address street
1 parent 1f086e4 commit 28c44ce

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

resources/views/default/includes/address.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
<p class="pb-1 text-xs">{{ $address->name }}</p>
77
@endif
88

9-
@if ($address->street)
9+
@if (is_array($address->street))
10+
@foreach ($address->street as $line)
11+
<p class="pb-1 text-xs">{{ $line }}</p>
12+
@endforeach
13+
@elseif($address->street)
1014
<p class="pb-1 text-xs">{{ $address->street }}</p>
1115
@endif
1216

src/Support/Address.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
class Address implements Arrayable
1313
{
1414
/**
15+
* @param null|string|string[] $street
1516
* @param array<array-key, null|int|float|string> $fields
1617
*/
1718
public function __construct(
1819
public ?string $company = null,
1920
public ?string $name = null,
20-
public ?string $street = null,
21+
public null|string|array $street = null,
2122
public ?string $state = null,
2223
public ?string $postal_code = null,
2324
public ?string $city = null,
@@ -56,7 +57,7 @@ public static function fromArray(array $values): self
5657
* @return array{
5758
* company: ?string,
5859
* name: ?string,
59-
* street: ?string,
60+
* street: null|string|string[],
6061
* state: ?string,
6162
* postal_code: ?string,
6263
* city: ?string,

src/Support/Buyer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static function fromArray(array $values): self
5959
* address: null|array{
6060
* company: ?string,
6161
* name: ?string,
62-
* street: ?string,
62+
* street: null|string|string[],
6363
* state: ?string,
6464
* postal_code: ?string,
6565
* city: ?string,
@@ -69,7 +69,7 @@ public static function fromArray(array $values): self
6969
* shipping_address: null|array{
7070
* company: ?string,
7171
* name: ?string,
72-
* street: ?string,
72+
* street: null|string|string[],
7373
* state: ?string,
7474
* postal_code: ?string,
7575
* city: ?string,

src/Support/Seller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static function fromArray(array $values): self
5656
* address: null|array{
5757
* company: ?string,
5858
* name: ?string,
59-
* street: ?string,
59+
* street: null|string|string[],
6060
* state: ?string,
6161
* postal_code: ?string,
6262
* city: ?string,

0 commit comments

Comments
 (0)