diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index e96bdcd2f..9421376ea 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -5,11 +5,13 @@ namespace MoonShine\Commands; use Illuminate\Contracts\Filesystem\FileNotFoundException; -use MoonShine\MoonShine; -use MoonShine\Providers\MoonShineServiceProvider; use function Laravel\Prompts\{confirm, intro, outro, spin, warning}; +use MoonShine\MoonShine; + +use MoonShine\Providers\MoonShineServiceProvider; + class InstallCommand extends MoonShineCommand { protected $signature = 'moonshine:install'; diff --git a/src/Fields/Json.php b/src/Fields/Json.php index e1790c348..cb44b30c4 100644 --- a/src/Fields/Json.php +++ b/src/Fields/Json.php @@ -342,7 +342,7 @@ protected function resolveOnApply(): ?Closure )->delete() ); - $items->each(fn($data) => $item->{$this->column()}()->updateOrCreate( + $items->each(fn ($data) => $item->{$this->column()}()->updateOrCreate( [$localKey => $data[$localKey] ?? null], $data )); diff --git a/src/Traits/Fields/WithAsyncSearch.php b/src/Traits/Fields/WithAsyncSearch.php index 7dbc6ffb7..0673925df 100644 --- a/src/Traits/Fields/WithAsyncSearch.php +++ b/src/Traits/Fields/WithAsyncSearch.php @@ -73,6 +73,7 @@ public function valuesWithProperties(bool $onlyCustom = false): Collection return $this->getMemoizeValues()->mapWithKeys(function (Model $item) use ($onlyCustom): array { $properties = $this->asyncResponseData($item); + return [ $item->getKey() => $onlyCustom ? data_get($properties, 'customProperties') diff --git a/src/Traits/Fields/WithSorts.php b/src/Traits/Fields/WithSorts.php index 09cf78ff2..6601f4fe5 100644 --- a/src/Traits/Fields/WithSorts.php +++ b/src/Traits/Fields/WithSorts.php @@ -8,7 +8,6 @@ trait WithSorts { - protected bool $sortable = false; /** diff --git a/tests/Fixtures/Models/Comment.php b/tests/Fixtures/Models/Comment.php index 0aef34d37..c2c9fdaee 100644 --- a/tests/Fixtures/Models/Comment.php +++ b/tests/Fixtures/Models/Comment.php @@ -21,7 +21,7 @@ class Comment extends Model ]; protected $casts = [ - 'data' => 'collection' + 'data' => 'collection', ]; public function item(): BelongsTo diff --git a/tests/Fixtures/Models/Item.php b/tests/Fixtures/Models/Item.php index d078707cb..b8acb26c9 100644 --- a/tests/Fixtures/Models/Item.php +++ b/tests/Fixtures/Models/Item.php @@ -32,7 +32,7 @@ class Item extends Model ]; protected $casts = [ - 'data' => 'collection' + 'data' => 'collection', ]; public function category(): BelongsTo diff --git a/tests/Pest.php b/tests/Pest.php index bf5143a0e..5bfef4787 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -12,10 +12,11 @@ use MoonShine\Tests\Fixtures\Factories\ItemFactory; use MoonShine\Tests\TestCase; use Pest\Expectation; -use Symfony\Component\HttpFoundation\Request as SymfonyRequest; use function Pest\Laravel\actingAs; +use Symfony\Component\HttpFoundation\Request as SymfonyRequest; + uses(TestCase::class) ->in(__DIR__); diff --git a/tests/Unit/Fields/SwitchBooleanFieldTest.php b/tests/Unit/Fields/SwitchBooleanFieldTest.php index c91b676d2..c5d411716 100644 --- a/tests/Unit/Fields/SwitchBooleanFieldTest.php +++ b/tests/Unit/Fields/SwitchBooleanFieldTest.php @@ -43,7 +43,7 @@ }); it('preview with auto update', function (): void { - expect($this->field->updateOnPreview(fn() => '/')->preview()) + expect($this->field->updateOnPreview(fn () => '/')->preview()) ->toBe( view('moonshine::fields.switch', [ 'element' => $this->field,