Skip to content

Commit

Permalink
Add attributes to the sites config (#3996)
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelKr authored Jul 15, 2021
1 parent 67b043f commit c4ea428
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Sites/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public function direction()
return $this->config['direction'] ?? 'ltr';
}

public function attributes()
{
return $this->config['attributes'] ?? [];
}

public function absoluteUrl()
{
if (Str::startsWith($url = $this->url(), '/')) {
Expand Down Expand Up @@ -91,6 +96,7 @@ public function augmentedArrayData()
'short_locale' => $this->shortLocale(),
'url' => $this->url(),
'direction' => $this->direction(),
'attributes' => $this->attributes(),
];
}

Expand Down
1 change: 1 addition & 0 deletions tests/Sites/SiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public function it_is_augmentable()
'short_locale' => 'en',
'url' => 'http://test.com',
'direction' => 'ltr',
'attributes' => [],
], $values->all());

$this->assertEquals(
Expand Down

0 comments on commit c4ea428

Please sign in to comment.