|
24 | 24 | use Moox\Core\Traits\Base\BaseInResource; |
25 | 25 | use Moox\Core\Traits\Tabs\TabsInResource; |
26 | 26 | use Moox\Security\FilamentActions\Passwords\SendPasswordResetLinksBulkAction; |
27 | | -use Moox\Sync\Models\Platform; |
28 | | -use Moox\Sync\Services\PlatformRelationService; |
29 | 27 | use Moox\User\Models\User; |
30 | 28 | use Moox\User\Resources\UserResource\Pages\CreateUser; |
31 | 29 | use Moox\User\Resources\UserResource\Pages\EditUser; |
@@ -86,38 +84,6 @@ public static function form(Form $form): Form |
86 | 84 | 'lg' => 12, |
87 | 85 | ]), |
88 | 86 |
|
89 | | - /* Must be provided by Sync, use a static maybe? |
90 | | - Select::make('platforms') |
91 | | - ->label('Platforms') |
92 | | - ->multiple() |
93 | | - ->options(function () { |
94 | | - return Platform::pluck('name', 'id')->toArray(); |
95 | | - }) |
96 | | - ->afterStateHydrated(function ($component, $state, $record) { |
97 | | - if ($record && class_exists(PlatformRelationService::class)) { |
98 | | - $platformService = app(PlatformRelationService::class); |
99 | | - $platforms = $platformService->getPlatformsForModel($record); |
100 | | - $component->state($platforms->pluck('id')->toArray()); |
101 | | - } |
102 | | - }) |
103 | | - ->dehydrated(false) |
104 | | - ->reactive() |
105 | | - ->afterStateUpdated(function ($state, callable $set, $record) { |
106 | | - if ($record && class_exists(PlatformRelationService::class)) { |
107 | | - $platformService = app(PlatformRelationService::class); |
108 | | - $platformService->syncPlatformsForModel($record, $state ?? []); |
109 | | - } |
110 | | - }) |
111 | | - ->preload() |
112 | | - ->searchable() |
113 | | - ->visible(fn () => class_exists(Platform::class)) |
114 | | - ->columnSpan([ |
115 | | - 'default' => 12, |
116 | | - 'md' => 12, |
117 | | - 'lg' => 12, |
118 | | - ]), |
119 | | - */ |
120 | | - |
121 | 87 | Select::make('gender') |
122 | 88 | ->label(__('core::user.gender')) |
123 | 89 | ->rules(['in:unknown,male,female,other']) |
|
0 commit comments