- Served the guest PWA at /g/{token} and introduced a mobile-friendly gallery page with lazy-loaded thumbnails, themed colors, lightbox, and download links plus new gallery data client (resources/js/guest/pages/PublicGalleryPage.tsx:1, resources/js/guest/services/galleryApi.ts:1, resources/js/guest/router.tsx:1). Added i18n strings for the public gallery experience (resources/js/guest/i18n/messages.ts:1).
- Ensured checkout step changes snap back to the progress bar on mobile via smooth scroll anchoring (resources/ js/pages/marketing/checkout/CheckoutWizard.tsx:1).
- Enabled tenant admins to export all approved event photos through a new download action that streams a ZIP archive, with translations and routing in place (app/Http/Controllers/Tenant/EventPhotoArchiveController.php:1, app/Filament/Resources/EventResource.php:1, routes/web.php:1, resources/lang/de/admin.php:1, resources/lang/en/admin.php:1).
125 lines
4.1 KiB
PHP
125 lines
4.1 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources;
|
|
|
|
use App\Filament\Resources\UserResource\Pages;
|
|
use App\Models\User;
|
|
use BackedEnum;
|
|
use Filament\Actions\ActionGroup;
|
|
use Filament\Actions\BulkActionGroup;
|
|
use Filament\Actions\DeleteBulkAction;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Actions\ViewAction;
|
|
use Filament\Schemas\Components\Section;
|
|
use Filament\Forms\Components\Textarea;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Form;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Columns\IconColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
use UnitEnum;
|
|
|
|
class UserResource extends Resource
|
|
{
|
|
protected static ?string $model = User::class;
|
|
|
|
protected static BackedEnum|string|null $navigationIcon = 'heroicon-o-user-circle';
|
|
|
|
protected static ?string $slug = 'users';
|
|
|
|
public static function getNavigationGroup(): string
|
|
{
|
|
return 'Plattform-Verwaltung';
|
|
}
|
|
|
|
public static function form(Schema $form): Schema
|
|
{
|
|
return $form
|
|
->schema([
|
|
Section::make('Personal Information')
|
|
->schema([
|
|
TextInput::make('first_name')
|
|
->required()
|
|
->maxLength(255),
|
|
TextInput::make('last_name')
|
|
->required()
|
|
->maxLength(255),
|
|
TextInput::make('username')
|
|
->required()
|
|
->unique(ignoreRecord: true)
|
|
->maxLength(255),
|
|
TextInput::make('email')
|
|
->email()
|
|
->required()
|
|
->unique(ignoreRecord: true),
|
|
Textarea::make('address')
|
|
->required()
|
|
->rows(3),
|
|
TextInput::make('phone')
|
|
->required()
|
|
->tel(),
|
|
])
|
|
->columns(2),
|
|
Section::make('Password')
|
|
->schema([
|
|
TextInput::make('password')
|
|
->password()
|
|
->required(fn (string $operation): bool => $operation === 'create')
|
|
->dehydrated(fn (?string $state): bool => filled($state))
|
|
->same('password_confirmation'),
|
|
TextInput::make('password_confirmation')
|
|
->password()
|
|
->required(fn (string $operation): bool => $operation === 'create')
|
|
->dehydrated(false),
|
|
])
|
|
->columns(1),
|
|
]);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('fullName')->sortable()->searchable(),
|
|
TextColumn::make('email')->searchable(),
|
|
TextColumn::make('username')->searchable(),
|
|
TextColumn::make('tenant.name')
|
|
->label(__('admin.common.tenant'))
|
|
->badge(),
|
|
TextColumn::make('phone'),
|
|
IconColumn::make('email_verified_at')
|
|
->label(__('admin.users.fields.verified'))
|
|
->boolean(),
|
|
])
|
|
->filters([])
|
|
->actions([
|
|
ActionGroup::make([
|
|
ViewAction::make(),
|
|
EditAction::make(),
|
|
]),
|
|
])
|
|
->bulkActions([
|
|
BulkActionGroup::make([
|
|
DeleteBulkAction::make(),
|
|
]),
|
|
]);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => Pages\ListUsers::route('/'),
|
|
'create' => Pages\CreateUser::route('/create'),
|
|
'edit' => Pages\EditUser::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|