Skip to content

Commit 4bbfb15

Browse files
AzGasimgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 63b9d8a commit 4bbfb15

17 files changed

Lines changed: 54 additions & 46 deletions

File tree

packages/category/src/Moox/Plugins/CategoryPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
use Filament\Contracts\Plugin;
88
use Filament\Panel;
99
use Filament\Support\Concerns\EvaluatesClosures;
10-
use Moox\Core\Support\Resources\ResourceNavigationRegistrar;
1110
use Moox\Category\Moox\Entities\Categories\Category\CategoryResource;
11+
use Moox\Core\Support\Resources\ResourceNavigationRegistrar;
1212

1313
class CategoryPlugin implements Plugin
1414
{

packages/core/config/core.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
use Moox\Category\Models\Category;
4+
use Moox\Draft\Models\Draft;
5+
use Moox\Media\Models\Media;
6+
use Moox\Record\Models\Record;
7+
use Moox\Tag\Models\Tag;
8+
39
/*
410
|--------------------------------------------------------------------------
511
| Moox Configuration
@@ -495,14 +501,14 @@
495501
*/
496502
'scopes' => [
497503
'origins' => [
498-
'media' => \Moox\Media\Models\Media::class,
499-
'draft' => \Moox\Draft\Models\Draft::class,
500-
'category' => \Moox\Category\Models\Category::class,
501-
'tag' => \Moox\Tag\Models\Tag::class,
502-
'record' => \Moox\Record\Models\Record::class,
504+
'media' => Media::class,
505+
'draft' => Draft::class,
506+
'category' => Category::class,
507+
'tag' => Tag::class,
508+
'record' => Record::class,
503509
],
504510
'sources' => [
505-
'draft' => \Moox\Draft\Models\Draft::class,
511+
'draft' => Draft::class,
506512
'global' => null,
507513
],
508514
],

packages/core/src/Console/Commands/ScopesSyncCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,3 @@ protected function collectScopeRows(): array
178178
return $rows;
179179
}
180180
}
181-

packages/core/src/Entities/BaseResource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected static function modifyEloquentQuery(Builder $query): Builder
3939
if (method_exists(static::class, 'addTaxonomyRelationsToQuery')) {
4040
$query = static::addTaxonomyRelationsToQuery($query);
4141
}
42+
4243
return ScopedResourceContext::applyScope($query, static::class);
4344
}
4445

packages/core/src/Models/Concerns/HasScopedModel.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Moox\Core\Models\Concerns;
44

5-
use Moox\Core\Services\ScopeRegistry;
65
use Moox\Core\Casts\ScopeCast;
6+
use Moox\Core\Services\ScopeRegistry;
77
use Moox\Core\Support\Scopes\ScopeValue;
88

99
trait HasScopedModel
@@ -54,8 +54,7 @@ public function deriveChildScope(
5454
?string $context = null,
5555
?string $boundary = null,
5656
?string $source = null,
57-
): ?string
58-
{
57+
): ?string {
5958
return ScopeValue::deriveChildString(
6059
$this->getCurrentScopeString(),
6160
$childOrigin,
@@ -80,8 +79,7 @@ public function deriveScopeForOrigin(
8079
?string $context = null,
8180
?string $boundary = null,
8281
?string $source = null,
83-
): ?string
84-
{
82+
): ?string {
8583
return $this->deriveChildScope($origin, $context, $boundary, $source);
8684
}
8785

@@ -106,7 +104,7 @@ public function resolveGlobalScopeString(): ?string
106104
);
107105
}
108106

109-
public function assignScope(string | ScopeValue | null $scope): void
107+
public function assignScope(string|ScopeValue|null $scope): void
110108
{
111109
$scopeString = ScopeValue::toStringOrNull($scope) ?? $this->resolveGlobalScopeString();
112110

packages/core/src/Models/Scope.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ public function getScopeObject(): ?ScopeValue
2828
return ScopeValue::parse($this->scope);
2929
}
3030
}
31-

packages/core/src/Services/ScopeAssignmentValidator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,3 @@ protected function resolveActorGroups(Authenticatable $actor): array
199199
return array_values(array_unique($groups));
200200
}
201201
}
202-

packages/core/src/Support/Resources/ChildResourceRegistrar.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public static function register(Panel $panel, string $parentResource, array $chi
127127
)
128128
->isActiveWhen(
129129
fn (): bool => request()->routeIs(
130-
$resource::withConfiguration($configurationKey, fn (): string | array => $resource::getNavigationItemActiveRoutePattern())
130+
$resource::withConfiguration($configurationKey, fn (): string|array => $resource::getNavigationItemActiveRoutePattern())
131131
)
132132
)
133133
->url(
@@ -186,7 +186,7 @@ protected static function resolveDefinition(string $parentResource, string $chil
186186

187187
return array_merge($child, [
188188
'origin' => $childOrigin,
189-
'slug' => trim($parentSlug, '/') . '/' . $childSlug,
189+
'slug' => trim($parentSlug, '/').'/'.$childSlug,
190190
'scope' => $childScope,
191191
'enabled' => (bool) value($child['enabled'] ?? true),
192192
'navigation_label' => value($child['label'] ?? null) ?? value($child['navigation_label'] ?? null),
@@ -203,7 +203,7 @@ protected static function resolveDefinition(string $parentResource, string $chil
203203
]);
204204
}
205205

206-
protected static function shouldShowNavigationForScope(string | ScopeValue | null $scope): bool
206+
protected static function shouldShowNavigationForScope(string|ScopeValue|null $scope): bool
207207
{
208208
$scopeString = ScopeValue::toStringOrNull($scope);
209209

@@ -223,7 +223,7 @@ protected static function hasScopesTable(): bool
223223
return static::$hasScopesTable ??= Schema::hasTable('scopes');
224224
}
225225

226-
protected static function resolveDefaultScopeMatchFromDatabase(string | ScopeValue | null $scope): string
226+
protected static function resolveDefaultScopeMatchFromDatabase(string|ScopeValue|null $scope): string
227227
{
228228
$parsed = ScopeValue::parse($scope);
229229

packages/core/src/Support/Resources/Concerns/HasScopedChildResource.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
use Filament\Actions\BulkAction;
66
use Filament\Forms\Components\Select;
77
use Filament\Notifications\Notification;
8-
use Illuminate\Support\Facades\Auth;
9-
use Illuminate\Database\Eloquent\Collection;
108
use Illuminate\Database\Eloquent\Builder;
9+
use Illuminate\Database\Eloquent\Collection;
1110
use Illuminate\Database\Eloquent\Model;
11+
use Illuminate\Support\Facades\Auth;
1212
use Illuminate\Support\Facades\Schema;
13+
use Moox\Core\Models\Scope;
1314
use Moox\Core\Services\ScopeAssignmentValidator;
1415
use Moox\Core\Services\ScopeRegistry;
1516
use Moox\Core\Support\Resources\ScopedResourceContext;
16-
use Moox\Core\Support\Scopes\ScopeValue;
1717

1818
trait HasScopedChildResource
1919
{
@@ -91,6 +91,7 @@ public static function getAssignScopeBulkAction(string $name = 'assignScope'): B
9191
foreach ($records as $record) {
9292
if (! method_exists($record, 'assignScope')) {
9393
$skippedCount++;
94+
9495
continue;
9596
}
9697

@@ -101,6 +102,7 @@ public static function getAssignScopeBulkAction(string $name = 'assignScope'): B
101102
$validation = $validator->validate($record, $targetScope, $actor);
102103
if (! ($validation['allowed'] ?? false)) {
103104
$skippedCount++;
105+
104106
continue;
105107
}
106108

@@ -151,7 +153,7 @@ protected static function getAssignableScopeOptions(): array
151153
}
152154

153155
/** @var array<string, array{scope: string, label: string|null, source: string, context: string, boundary: string}> $rows */
154-
$rows = \Moox\Core\Models\Scope::query()
156+
$rows = Scope::query()
155157
->where('origin', $origin)
156158
->where('is_active', true)
157159
->orderByRaw('label is null, label asc, scope asc')

packages/core/src/Support/Resources/ScopedResourceContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use Illuminate\Database\Eloquent\Builder;
66
use Illuminate\Database\Eloquent\Model;
77
use Illuminate\Support\Facades\Schema;
8-
use Moox\Core\Support\Scopes\ScopeValue;
98
use Moox\Core\Support\Scopes\ScopeQuery;
9+
use Moox\Core\Support\Scopes\ScopeValue;
1010

1111
class ScopedResourceContext
1212
{

0 commit comments

Comments
 (0)