Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Aug 20, 2024
2 parents 7b177e9 + 8b4de67 commit 7630426
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ![Layouts field for MoonShine](https://github.com/moonshine-software/moonshine/raw/2.x/art/lego.png)
## Layouts field for MoonShine - Beta version
## Layouts field for MoonShine

## Quick start

Expand All @@ -12,7 +12,7 @@ composer require moonshine/layouts-field
### Usage

Field Layouts for MoonShine allows you to easily manage repeating groups of fields. You will be able to add, delete and sort groups consisting of basic fields.
There are some restrictions on the use of fields in the Layouts field. You can use any basic fields except **Json** and **Relationships** fields.
There are some restrictions on the use of fields in the Layouts field. You can use any basic fields except **Relationships** fields.

```php
use MoonShine\Layouts\Fields\Layouts;
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/LayoutsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public function it_json_with_image(): void

$this->store($model, $data);

$first = static fn(TestModel $model): array => $model->data->findByName('first')->get('json');
$second = static fn(TestModel $model): array => $model->data->findByName('second')->get('json');
$first = static fn (TestModel $model): array => $model->data->findByName('first')->get('json');
$second = static fn (TestModel $model): array => $model->data->findByName('second')->get('json');

$this->assertEquals(['key 1' => 'value 1', 'key 2' => 'value 2'], $first($model));
$this->assertEquals([['title' => 'Title 1', 'image' => $image->hashName()]], $second($model));
Expand Down Expand Up @@ -125,8 +125,8 @@ public function it_with_image(): void

$this->store($model, $data);

$first = static fn(TestModel $model): LayoutItem => $model->data->findByName('first');
$second = static fn(TestModel $model): LayoutItem => $model->data->findByName('second');
$first = static fn (TestModel $model): LayoutItem => $model->data->findByName('first');
$second = static fn (TestModel $model): LayoutItem => $model->data->findByName('second');

$this->assertEquals('First title', $first($model)->get('title'));
$this->assertEquals('Second title', $second($model)->get('title'));
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/TestResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function fields(): array
]),
Column::make([
Image::make('Image')->removable(),
])
]),
]),
Json::make('Json')->keyValue(),
])->addLayout('second', 'second', [
Expand Down

0 comments on commit 7630426

Please sign in to comment.