Skip to content

Commit b9c928a

Browse files
lee-togithub-actions[bot]
authored andcommitted
Fix styling
1 parent 3b7a94f commit b9c928a

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/Casts/LayoutsCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function get(Model $model, string $key, mixed $value, array $attributes):
1818

1919
$data = Json::decode($attributes[$key]);
2020

21-
if($data instanceof LayoutItemCollection) {
21+
if ($data instanceof LayoutItemCollection) {
2222
return $data;
2323
}
2424

@@ -35,7 +35,7 @@ private function _map(mixed $value): LayoutItemCollection
3535
$values = [];
3636

3737
try {
38-
if(is_string($value) && str($value)->isJson()) {
38+
if (is_string($value) && str($value)->isJson()) {
3939
$value = json_decode($value, true, 512, JSON_THROW_ON_ERROR);
4040
}
4141

src/Http/Controllers/LayoutsController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
namespace MoonShine\Layouts\Http\Controllers;
66

77
use MoonShine\Laravel\Collections\Fields;
8-
use MoonShine\Support\Enums\PageType;
9-
use MoonShine\Support\Enums\ToastType;
108
use MoonShine\Laravel\Http\Controllers\MoonShineController;
119
use MoonShine\Laravel\Http\Responses\MoonShineJsonResponse;
10+
use MoonShine\Laravel\MoonShineRequest;
1211
use MoonShine\Layouts\Casts\LayoutItem;
1312
use MoonShine\Layouts\Collections\LayoutItemCollection;
1413
use MoonShine\Layouts\Fields\Layout;
1514
use MoonShine\Layouts\Fields\Layouts;
16-
use MoonShine\Laravel\MoonShineRequest;
15+
use MoonShine\Support\Enums\PageType;
16+
use MoonShine\Support\Enums\ToastType;
1717
use Throwable;
1818

1919
final class LayoutsController extends MoonShineController
@@ -25,7 +25,7 @@ public function store(MoonShineRequest $request): MoonShineJsonResponse
2525
{
2626
$field = $this->getField($request);
2727

28-
if(is_null($field)) {
28+
if (is_null($field)) {
2929
return MoonShineJsonResponse::make()
3030
->toast('Field not found', ToastType::ERROR);
3131
}
@@ -43,7 +43,7 @@ public function store(MoonShineRequest $request): MoonShineJsonResponse
4343
->findByName($request->get('name'))
4444
?->removeButton($field->getRemoveButton());
4545

46-
if(is_null($layout)) {
46+
if (is_null($layout)) {
4747
return MoonShineJsonResponse::make()
4848
->toast('Layout not found', ToastType::ERROR);
4949
}
@@ -52,7 +52,7 @@ public function store(MoonShineRequest $request): MoonShineJsonResponse
5252
->collect('counts')
5353
->get($layout->name(), 0);
5454

55-
if($layout->hasLimit() && $layout->limit() <= $layoutCount) {
55+
if ($layout->hasLimit() && $layout->limit() <= $layoutCount) {
5656
return MoonShineJsonResponse::make()
5757
->toast("Limit count {$layout->limit()}", ToastType::ERROR);
5858
}
@@ -67,7 +67,7 @@ private function getField(MoonShineRequest $request): ?Layouts
6767
{
6868
$page = $request->getPage();
6969

70-
if(! $resource = $request->getResource()) {
70+
if (! $resource = $request->getResource()) {
7171
$fields = Fields::make(is_null($page->getPageType()) ? $page->components() : $page->getFields());
7272
} else {
7373
$fields = match ($page->getPageType()) {

tests/TestCase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
namespace MoonShine\Layouts\Tests;
44

55
use Illuminate\Foundation\Testing\RefreshDatabase;
6-
use MoonShine\Layouts\Providers\MoonShineLayoutsServiceProvider;
7-
use MoonShine\Layouts\Tests\Fixtures\TestResource;
8-
use MoonShine\MenuManager\MenuItem;
96
use MoonShine\Laravel\Models\MoonshineUser;
107
use MoonShine\Laravel\Models\MoonshineUserRole;
118
use MoonShine\Laravel\Providers\MoonShineServiceProvider;
9+
use MoonShine\Layouts\Providers\MoonShineLayoutsServiceProvider;
10+
use MoonShine\Layouts\Tests\Fixtures\TestResource;
1211
use Orchestra\Testbench\TestCase as Orchestra;
1312

1413
abstract class TestCase extends Orchestra

0 commit comments

Comments
 (0)