Updated field lable, length and default value in report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

This commit is contained in:
dhanabalan
2026-05-01 14:14:49 +05:30
parent 252dcc7afd
commit fba8101da3

View File

@@ -33,8 +33,10 @@ class UserResource extends Resource
return $form return $form
->schema([ ->schema([
Forms\Components\Select::make('plant_id') Forms\Components\Select::make('plant_id')
->label('Plant Name')
->relationship('plant', 'name') ->relationship('plant', 'name')
->nullable() ->nullable()
->searchable()
->reactive() ->reactive()
->options(function (callable $get) { ->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id; $userHas = Filament::auth()->user()->plant_id;
@@ -45,8 +47,10 @@ class UserResource extends Resource
return optional(User::latest()->first())->plant_id; return optional(User::latest()->first())->plant_id;
}), }),
Forms\Components\TextInput::make('name') Forms\Components\TextInput::make('name')
->label('Name')
->required() ->required()
->autofocus() ->autofocus()
->minLength(3)
// ->reactive() // ->reactive()
->live(debounce: 600) ->live(debounce: 600)
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
@@ -54,6 +58,7 @@ class UserResource extends Resource
}) })
->maxLength(255), ->maxLength(255),
Forms\Components\TextInput::make('email') Forms\Components\TextInput::make('email')
->label('Email')
// ->email() // ->email()
->unique(ignoreRecord: true) ->unique(ignoreRecord: true)
->required() ->required()
@@ -66,9 +71,12 @@ class UserResource extends Resource
// ->prefix(fn ($get) => $get('name') ?? null) // ->prefix(fn ($get) => $get('name') ?? null)
// ->suffix('@cripumps.com') // ->suffix('@cripumps.com')
->maxLength(255), ->maxLength(255),
Forms\Components\DateTimePicker::make('email_verified_at'), Forms\Components\DateTimePicker::make('email_verified_at')
->label('Email Verified At'),
Forms\Components\TextInput::make('password') Forms\Components\TextInput::make('password')
->label('Password')
->password() ->password()
->minLength(3)
->revealable() ->revealable()
->required() ->required()
// ->dehydrateStateUsing(fn (string $state): string => Hash::make($state)) // ->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
@@ -77,6 +85,7 @@ class UserResource extends Resource
// ->multiple() // ->multiple()
// ->relationship('roles', 'name'), // ->relationship('roles', 'name'),
Forms\Components\Select::make('roles') Forms\Components\Select::make('roles')
->label('Roles')
->relationship('roles', 'name') ->relationship('roles', 'name')
// ->relationship(name: 'roles', titleAttribute: 'name') // ->relationship(name: 'roles', titleAttribute: 'name')
// ->saveRelationshipsUsing(function (Model $record, $state) { // ->saveRelationshipsUsing(function (Model $record, $state) {
@@ -110,7 +119,8 @@ class UserResource extends Resource
return ($currentPage - 1) * $perPage + $rowLoop->iteration; return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}), }),
Tables\Columns\TextColumn::make('plant.name') Tables\Columns\TextColumn::make('plant.name')
->label('Plant') ->label('Plant Name')
->default('All')
->alignCenter() ->alignCenter()
->sortable() ->sortable()
->searchable(), ->searchable(),
@@ -144,8 +154,7 @@ class UserResource extends Resource
->label('Updated At') ->label('Updated At')
->dateTime() ->dateTime()
->alignCenter() ->alignCenter()
->sortable() ->sortable(),
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at') Tables\Columns\TextColumn::make('deleted_at')
->label('Deleted At') ->label('Deleted At')
->dateTime() ->dateTime()