schema([ Select::make('company_type') ->label('Kompaniýa görnüşi') ->native(false) ->options(CompanyType::options()) ->default(CompanyType::default()) ->required(), TextInput::make('name') ->required(), TextInput::make('ssb') ->label('Şahsy salgyt belgisi') ->unique(ignoreRecord: true) ->required(), TextInput::make('hb') ->label('HB') ->unique(ignoreRecord: true) ->required(), Select::make('bank_id') ->label('Bank') ->native(false) ->options(BankRepository::make()->options()) ->searchable() ->required(), Toggle::make('default') ->default(false) ->label('Is default'), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('company_type') ->badge() ->formatStateUsing(fn (string $state): string => CompanyType::option($state)) ->color(fn (string $state): string => CompanyType::statusClass($state)), TextColumn::make('ssb') ->label('Şahsy salgyt belgisi') ->searchable(), TextColumn::make('hb') ->label('HB'), ToggleColumn::make('default'), ]) ->filters([ Filter::make('default'), ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListUserCompanies::route('/'), 'create' => Pages\CreateUserCompany::route('/create'), 'edit' => Pages\EditUserCompany::route('/{record}/edit'), ]; } }