Skip to content

Commit

Permalink
Rename append and prepend to suffix and prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed Oct 25, 2023
1 parent 8b77c79 commit c2565f0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,20 @@ The `weekStartsOn` method has been renamed to `firstDayOfWeek`.
+DatePicker::make('Date')->firstDayOfWeek(1)
```

The `prepend` method has been renamed to `prefix`.

```diff
-Number::make('Price')->prepend('$')
+Number::make('Price')->prefix('$')
```

The `append` method has been renamed to `suffix`.

```diff
-Number::make('Price')->append('€')
+Number::make('Price')->suffix('€')
```

The `stylisedUi` method has been renamed to `stylized` on the `TrueFalse` field.

```diff
Expand Down
8 changes: 4 additions & 4 deletions src/Fields/Settings/Affixable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@

trait Affixable
{
public function append(string $value): static
public function prefix(string $value): static
{
$this->settings['append'] = $value;
$this->settings['prepend'] = $value;

return $this;
}

public function prepend(string $value): static
public function suffix(string $value): static
{
$this->settings['prepend'] = $value;
$this->settings['append'] = $value;

return $this;
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Fields/Settings/Affixable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

trait Affixable
{
public function testAppend()
public function testSuffix()
{
$settings = $this->field::make($this->label('Append'))->append('%')->get();
$settings = $this->field::make($this->label('Suffix'))->suffix('%')->get();
$this->assertSame('%', $settings['append']);
}

public function testPrepend()
public function testPrefix()
{
$settings = $this->field::make($this->label('Prepend'))->prepend('$')->get();
$settings = $this->field::make($this->label('Prefix'))->prefix('$')->get();
$this->assertSame('$', $settings['prepend']);
}
}

0 comments on commit c2565f0

Please sign in to comment.