Skip to content

Commit

Permalink
Update UserResource.php
Browse files Browse the repository at this point in the history
  • Loading branch information
adrolli committed Feb 10, 2025
1 parent fc05f96 commit 719300a
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions packages/user/src/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
use Moox\Core\Traits\Base\BaseInResource;
use Moox\Core\Traits\Tabs\TabsInResource;
use Moox\Security\FilamentActions\Passwords\SendPasswordResetLinksBulkAction;
use Moox\Sync\Models\Platform;
use Moox\Sync\Services\PlatformRelationService;
use Moox\User\Models\User;
use Moox\User\Resources\UserResource\Pages\CreateUser;
use Moox\User\Resources\UserResource\Pages\EditUser;
Expand Down Expand Up @@ -86,38 +84,6 @@ public static function form(Form $form): Form
'lg' => 12,
]),

/* Must be provided by Sync, use a static maybe?
Select::make('platforms')
->label('Platforms')
->multiple()
->options(function () {
return Platform::pluck('name', 'id')->toArray();
})
->afterStateHydrated(function ($component, $state, $record) {
if ($record && class_exists(PlatformRelationService::class)) {
$platformService = app(PlatformRelationService::class);
$platforms = $platformService->getPlatformsForModel($record);
$component->state($platforms->pluck('id')->toArray());
}
})
->dehydrated(false)
->reactive()
->afterStateUpdated(function ($state, callable $set, $record) {
if ($record && class_exists(PlatformRelationService::class)) {
$platformService = app(PlatformRelationService::class);
$platformService->syncPlatformsForModel($record, $state ?? []);
}
})
->preload()
->searchable()
->visible(fn () => class_exists(Platform::class))
->columnSpan([
'default' => 12,
'md' => 12,
'lg' => 12,
]),
*/

Select::make('gender')
->label(__('core::user.gender'))
->rules(['in:unknown,male,female,other'])
Expand Down

0 comments on commit 719300a

Please sign in to comment.