diff --git a/ARTISAN.md b/ARTISAN.md index a24ffd8..841450d 100644 --- a/ARTISAN.md +++ b/ARTISAN.md @@ -8,5 +8,10 @@ a make:model ModelName -f // also creates a factory a make:model ModelName -s // also creates a database seeder a make:model ModelName -mfcs // creates migration, factory, controller and seeder +a make:factory GutachterFactory -a make:factory GutachterFactory \ No newline at end of file +https://fakerphp.org/ + +Thomas Schranz +Adamgasse 9a +2.Stock diff --git a/app/Filament/Pages/Auth/Register.php b/app/Filament/Pages/Auth/Register.php index 44a1044..726ab20 100644 --- a/app/Filament/Pages/Auth/Register.php +++ b/app/Filament/Pages/Auth/Register.php @@ -7,6 +7,7 @@ use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber; use Filament\Auth\Pages\Register as BaseRegister; use Filament\Forms\Components\Checkbox; use Filament\Forms\Components\Select; +use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Schemas\Components\Fieldset; use Filament\Schemas\Components\Utilities\Get; @@ -18,6 +19,8 @@ use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput; class Register extends BaseRegister { + public User $user; + public function form(Schema $schema): Schema { return $schema @@ -39,28 +42,35 @@ class Register extends BaseRegister ->description('Mit einem Konto verbinden.') ->schema([ $this->getKontoModusFormComponent(), - /** OLD */ + /** BESTEHENDES KONTO */ $this->getKontoFormComponent(), /** NEU */ Fieldset::make('Rechnungsdaten') ->visible(fn (Get $get): bool => $get('konto') == 'new') ->schema([ - $this->getCompanyFormComponent(), - $this->getUIDFormComponent(), - $this->getPLZFormComponent(), - $this->getLocationFormComponent(), - $this->getAdresseFormComponent(), - $this->getCountryFormComponent(), + TextInput::make('company') + ->label('Firma') + ->required(), + TextInput::make('uid_number') + ->label('UID Nummer') + ->rules([new VatNumber]) + ->required(), + Textarea::make('address') + ->label('Adresse') + ->required(), + TextInput::make('country') + ->label('Land') + ->default('Österreich') + ->required(), ])->columnSpan(4), Fieldset::make('Kontaktperson') ->visible(fn (Get $get): bool => $get('konto') == 'new') ->schema([ - $this->getKontoGenderFormComponent(), - $this->getTitleFormComponent(), - $this->getKontoFirstNameFormComponent(), - $this->getKontoLastNameFormComponent(), - $this->getKontoEmailFormComponent(), - $this->getPhoneFormComponent(), + // $this->getKontoGenderFormComponent(), + // $this->getTitleFormComponent(), + // $this->getNameFormComponent(), + // $this->getKontoEmailFormComponent(), + // $this->getPhoneFormComponent(), ])->columnSpan(4), ]), @@ -72,7 +82,9 @@ class Register extends BaseRegister Fieldset::make('Bitte lesen und akzeptieren Sie die allgemeinen Geschäftsbedignungen um die Registrierung abzuschließen.') ->visible(fn (Get $get): bool => $get('konto') == 'new') ->schema([ - $this->getABGFormComponent(), + Checkbox::make('agb_akzeptiert') + ->label('ABG akzeptieren') + ->required(), ]), View::make('pages.agb'), @@ -130,7 +142,7 @@ class Register extends BaseRegister 'Um das erstellte Profil zu aktivieren muß der Kontoinhaber die Anmeldung im Programm freischalten', ]) ->visible(fn (Get $get): bool => $get('konto') == 'old') - ->options(Konto::query()->pluck('konto_company', 'id')) + ->options(Konto::query()->pluck('company', 'id')) ->searchable() ->required(); } @@ -138,17 +150,9 @@ class Register extends BaseRegister /** * KONTO NEU */ - protected function getABGFormComponent(): Checkbox - { - return Checkbox::make('konto_agb_akzeptiert') - ->label('ABG akzeptieren') - ->visible(fn (Get $get): bool => $get('konto') == 'new') - ->required(); - } - protected function getTitleFormComponent(): TextInput { - return TextInput::make('konto_title') + return TextInput::make('title') ->label('Title') ->visible(fn (Get $get): bool => $get('konto') == 'new') ->required(); @@ -156,7 +160,7 @@ class Register extends BaseRegister protected function getKontoGenderFormComponent(): Select { - return Select::make('konto_gender') + return Select::make('gender') ->columnSpan(2) ->label('Geschlecht') ->visible(fn (Get $get): bool => $get('konto') == 'new') @@ -168,25 +172,9 @@ class Register extends BaseRegister ->required(); } - protected function getKontoFirstNameFormComponent(): TextInput - { - return TextInput::make('konto_first_name') - ->label('Vorname') - ->visible(fn (Get $get): bool => $get('konto') == 'new') - ->required(); - } - - protected function getKontoLastNameFormComponent(): TextInput - { - return TextInput::make('konto_last_name') - ->label('Nachname') - ->visible(fn (Get $get): bool => $get('konto') == 'new') - ->required(); - } - protected function getCompanyFormComponent(): TextInput { - return TextInput::make('konto_company') + return TextInput::make('konto.company') ->label('Firma') ->visible(fn (Get $get): bool => $get('konto') == 'new') ->required(); @@ -194,60 +182,18 @@ class Register extends BaseRegister protected function getKontoEmailFormComponent(): TextInput { - return TextInput::make('konto_email') + return TextInput::make('email') ->label('E-Mail') ->visible(fn (Get $get): bool => $get('konto') == 'new') ->unique(table: Konto::class) ->required(); } - protected function getAdresseFormComponent(): TextInput - { - return TextInput::make('konto_address') - ->label('Adresse') - ->visible(fn (Get $get): bool => $get('konto') == 'new') - ->required(); - } - - protected function getLocationFormComponent(): TextInput - { - return TextInput::make('konto_location') - ->label('Ort') - ->visible(fn (Get $get): bool => $get('konto') == 'new') - ->required(); - } - - protected function getPLZFormComponent(): TextInput - { - return TextInput::make('konto_plz') - ->label('Postleitzahl') - ->visible(fn (Get $get): bool => $get('konto') == 'new') - ->required(); - } - protected function getPhoneFormComponent(): PhoneInput { - return PhoneInput::make('konto_phone') + return PhoneInput::make('phone') ->label('Telefon') ->visible(fn (Get $get): bool => $get('konto') == 'new') ->defaultCountry('AT'); } - - protected function getCountryFormComponent(): TextInput - { - return TextInput::make('konto_country') - ->label('Land') - ->default('Österreich') - ->visible(fn (Get $get): bool => $get('konto') == 'new') - ->required(); - } - - protected function getUIDFormComponent(): TextInput - { - return TextInput::make('konto_uid_number') - ->label('UID Nummer') - ->visible(fn (Get $get): bool => $get('konto') == 'new') - ->rules([new VatNumber]) - ->required(); - } } diff --git a/app/Filament/Resources/KontoOptions/KontoOptionResource.php b/app/Filament/Resources/KontoOptions/KontoOptionResource.php deleted file mode 100644 index 58ab46a..0000000 --- a/app/Filament/Resources/KontoOptions/KontoOptionResource.php +++ /dev/null @@ -1,64 +0,0 @@ - ListKontoOptions::route('/'), - 'create' => CreateKontoOption::route('/create'), - 'edit' => EditKontoOption::route('/{record}/edit'), - ]; - } - - public static function getNavigationBadge(): ?string - { - return parent::getEloquentQuery()->count(); - } -} diff --git a/app/Filament/Resources/KontoOptions/Pages/CreateKontoOption.php b/app/Filament/Resources/KontoOptions/Pages/CreateKontoOption.php deleted file mode 100644 index 6c760b6..0000000 --- a/app/Filament/Resources/KontoOptions/Pages/CreateKontoOption.php +++ /dev/null @@ -1,11 +0,0 @@ -components([ - TextInput::make('konto_company') + TextInput::make('company') ->label('Firma') ->required(), - TextInput::make('konto_email') + TextInput::make('email') ->label('E-Mail') ->unique(table: Konto::class) ->required(), - TextInput::make('konto_address') + TextInput::make('address') ->label('Adresse') ->required(), - TextInput::make('konto_location') + TextInput::make('location') ->label('Ort') ->required(), - TextInput::make('konto_plz') + TextInput::make('plz') ->label('Postleitzahl') ->required(), - PhoneInput::make('konto_phone') + PhoneInput::make('phone') ->label('Telefon') ->defaultCountry('AT'), - TextInput::make('konto_country') + TextInput::make('country') ->label('Land') ->default('Österreich') ->required(), - TextInput::make('konto_uid_number') + TextInput::make('uid_number') ->label('UID Nummer') ->rules([new VatNumber]) ->required(), - TextInput::make('konto_title') + TextInput::make('title') ->label('Title') ->required(), - Select::make('konto_gender') + Select::make('gender') ->label('Geschlecht') ->options([ 'Herr' => 'Herr', @@ -53,11 +53,8 @@ class KontoForm 'Non-binary' => 'Non-binary', ]) ->required(), - TextInput::make('konto_first_name') - ->label('Vorname') - ->required(), - TextInput::make('konto_last_name') - ->label('Nachname') + TextInput::make('name') + ->label('Name') ->required(), ]); } diff --git a/app/Filament/Resources/Kontos/Tables/KontosTable.php b/app/Filament/Resources/Kontos/Tables/KontosTable.php index 07ec7a0..48e7b68 100644 --- a/app/Filament/Resources/Kontos/Tables/KontosTable.php +++ b/app/Filament/Resources/Kontos/Tables/KontosTable.php @@ -23,42 +23,42 @@ class KontosTable return $table ->columns([ // TextColumn::make('id'), - // TextColumn::make('konto_gender')->label('Geschlecht'), - // TextColumn::make('konto_title')->label('Title'), - // TextColumn::make('konto_first_name')->label('Vorname'), - // IconColumn::make('konto_agb_akzeptiert') + // TextColumn::make('gender')->label('Geschlecht'), + // TextColumn::make('title')->label('Title'), + // TextColumn::make('first_name')->label('Vorname'), + // IconColumn::make('agb_akzeptiert') // ->label('AGB') // ->boolean() // ->trueIcon(Heroicon::OutlinedCheckBadge) // ->falseIcon(Heroicon::OutlinedXMark), - // PhoneColumn::make('konto_phone') + // PhoneColumn::make('phone') // ->label('Telefon') // ->displayFormat(PhoneInputNumberType::INTERNATIONAL), - // TextColumn::make('konto_email') + // TextColumn::make('email') // ->copyable() // ->copyMessage('E-Mail wurde kopiert') // ->copyMessageDuration(1500) // ->label('E-mail'), - TextColumn::make('konto_company')->label('Firma') - ->description(fn ($record): string => $record->konto_address.', '.$record->konto_location), + TextColumn::make('company')->label('Firma') + ->description(fn ($record): string => $record->address.', '.$record->location), - TextColumn::make('konto_option.name') + TextColumn::make('option.name') ->icon(Heroicon::CurrencyEuro) // ->iconColor('success') // ->badge() ->label('Plan') - ->description(fn ($record): string => $record->konto_option->payment_plan->name), + ->description(fn ($record): string => $record->option->payment_plan->name), - TextColumn::make('konto_gutachten_abgeschlossen') + TextColumn::make('gutachten_abgeschlossen') ->size(TextSize::Large) ->weight(FontWeight::Bold) ->label('Abgeschlossen') ->color('primary') ->description('Gutachten') ->alignCenter(), - TextColumn::make('konto_gutachten_zahl') + TextColumn::make('gutachten_zahl') ->size(TextSize::Large) ->weight(FontWeight::Bold) ->label('Freigeschalted') diff --git a/app/Filament/Resources/Permissions/PermissionResource.php b/app/Filament/Resources/Permissions/PermissionResource.php index d812533..9a82cf7 100644 --- a/app/Filament/Resources/Permissions/PermissionResource.php +++ b/app/Filament/Resources/Permissions/PermissionResource.php @@ -27,9 +27,9 @@ class PermissionResource extends Resource protected static ?string $recordTitleAttribute = 'name'; - protected static ?string $navigationLabel = 'Berechtigungen'; + protected static ?string $navigationLabel = 'Berechtigung'; - protected static ?string $modelLabel = 'Berechtigungen'; + protected static ?string $modelLabel = 'Berechtigung'; protected static ?string $pluralModelLabel = 'Berechtigungen'; diff --git a/app/Filament/Resources/Plans/Pages/CreatePlan.php b/app/Filament/Resources/Plans/Pages/CreatePlan.php new file mode 100644 index 0000000..735743f --- /dev/null +++ b/app/Filament/Resources/Plans/Pages/CreatePlan.php @@ -0,0 +1,11 @@ + ListPlans::route('/'), + 'create' => CreatePlan::route('/create'), + 'edit' => EditPlan::route('/{record}/edit'), + ]; + } + + public static function getNavigationBadge(): ?string + { + return parent::getEloquentQuery()->count(); + } +} diff --git a/app/Filament/Resources/KontoOptions/Schemas/KontoOptionForm.php b/app/Filament/Resources/Plans/Schemas/PlanForm.php similarity index 72% rename from app/Filament/Resources/KontoOptions/Schemas/KontoOptionForm.php rename to app/Filament/Resources/Plans/Schemas/PlanForm.php index f3c7acc..994f843 100644 --- a/app/Filament/Resources/KontoOptions/Schemas/KontoOptionForm.php +++ b/app/Filament/Resources/Plans/Schemas/PlanForm.php @@ -1,10 +1,10 @@ columns([ - TextColumn::make('name') - ->description(fn ($record): string => $record->description) - ->wrap(), - TextColumn::make('payment_plan.name') - ->label('Zahlung'), - TextColumn::make('number_user')->alignCenter()->badge()->label('Benutzer'), - TextColumn::make('number_gutachter')->alignCenter()->badge()->label('Gutachter'), + // ]) ->filters([ // diff --git a/app/Filament/Resources/Users/Pages/ListUsers.php b/app/Filament/Resources/Users/Pages/ListUsers.php index 6f0e73d..ac30e03 100644 --- a/app/Filament/Resources/Users/Pages/ListUsers.php +++ b/app/Filament/Resources/Users/Pages/ListUsers.php @@ -13,7 +13,12 @@ class ListUsers extends ListRecords protected function getHeaderActions(): array { return [ - CreateAction::make(), + CreateAction::make() + ->mutateDataUsing(function (array $data): array { + $data['konto_id'] = auth()->user()->konto_id; + + return $data; + }), ]; } } diff --git a/app/Filament/Resources/Users/Schemas/UserForm.php b/app/Filament/Resources/Users/Schemas/UserForm.php index e50e557..ae66eb4 100644 --- a/app/Filament/Resources/Users/Schemas/UserForm.php +++ b/app/Filament/Resources/Users/Schemas/UserForm.php @@ -2,22 +2,55 @@ namespace App\Filament\Resources\Users\Schemas; +use App\Models\User; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; +use Filament\Schemas\Components\Section; use Filament\Schemas\Schema; +use Illuminate\Validation\Rules\Password; class UserForm { + public User $user; + public static function configure(Schema $schema): Schema { + return $schema ->components([ - TextInput::make('name'), + Section::make('Benutzerkonto') + ->icon('lucide-user') + ->schema([ + TextInput::make('name')->required(), + TextInput::make('email')->email() + ->required() + ->label('E-Mail'), + ]), + Section::make('Sicherheit') + ->icon('lucide-lock') + ->schema([ + TextInput::make('password') + ->label('Passwort') + ->password() // Masks the input + ->required() + ->revealable() + ->rule(Password::min(8)->mixedCase()->numbers()->symbols()->uncompromised()) // Enforces strong password policies + ->dehydrateStateUsing(fn ($state) => bcrypt($state)) // Hashes the password before saving + ->label('Password'), + TextInput::make('password_confirmation') + ->password() // Masks the input + ->required() + ->same('password') // Validates that this matches the 'password' field + ->label('Passwort Bestätigen'), + ]), + Select::make('roles') + ->label('Rolle') + ->visible(fn () => auth()->user()->hasRole('super_admin')) ->relationship('roles', 'name') ->multiple() ->preload() ->searchable(), - ]); + ])->columns(1); } } diff --git a/app/Filament/Resources/Users/Tables/UsersTable.php b/app/Filament/Resources/Users/Tables/UsersTable.php index 1a9251d..2938226 100644 --- a/app/Filament/Resources/Users/Tables/UsersTable.php +++ b/app/Filament/Resources/Users/Tables/UsersTable.php @@ -18,10 +18,12 @@ class UsersTable return $table ->columns([ TextColumn::make('name'), + TextColumn::make('konto.company')->badge(), + TextColumn::make('email')->copyable()->label('E-Mail'), // ]) ->filters([ - TrashedFilter::make(), + TrashedFilter::make()->visible(fn () => auth()->user()->hasRole('super_admin')), ]) ->recordActions([ EditAction::make(), @@ -31,7 +33,7 @@ class UsersTable DeleteBulkAction::make(), ForceDeleteBulkAction::make(), RestoreBulkAction::make(), - ]), + ])->visible(fn () => auth()->user()->hasRole('super_admin')), ]); } } diff --git a/app/Filament/Resources/Users/UserResource.php b/app/Filament/Resources/Users/UserResource.php index a6d62ca..9968bf3 100644 --- a/app/Filament/Resources/Users/UserResource.php +++ b/app/Filament/Resources/Users/UserResource.php @@ -3,8 +3,6 @@ namespace App\Filament\Resources\Users; use App\Filament\Clusters\Verwaltung\VerwaltungCluster; -use App\Filament\Resources\Users\Pages\CreateUser; -use App\Filament\Resources\Users\Pages\EditUser; use App\Filament\Resources\Users\Pages\ListUsers; use App\Filament\Resources\Users\Schemas\UserForm; use App\Filament\Resources\Users\Tables\UsersTable; @@ -57,8 +55,6 @@ class UserResource extends Resource { return [ 'index' => ListUsers::route('/'), - 'create' => CreateUser::route('/create'), - 'edit' => EditUser::route('/{record}/edit'), ]; } diff --git a/app/Livewire/KontoSwitch.php b/app/Livewire/KontoSwitch.php index 50e9cee..bb4883e 100644 --- a/app/Livewire/KontoSwitch.php +++ b/app/Livewire/KontoSwitch.php @@ -12,7 +12,7 @@ class KontoSwitch extends Component public function mount() { - $this->kontos = Konto::pluck('konto_company', 'id')->all(); + $this->kontos = Konto::pluck('company', 'id')->all(); } public function render() diff --git a/app/Models/Konto.php b/app/Models/Konto.php index 8f53a13..c24ec32 100644 --- a/app/Models/Konto.php +++ b/app/Models/Konto.php @@ -40,8 +40,8 @@ class Konto extends Model return KontoFactory::new(); } - public function konto_option(): HasOne + public function plan(): HasOne { - return $this->hasOne(KontoOption::class, 'id', 'konto_option_id'); + return $this->hasOne(Plan::class); } } diff --git a/app/Models/KontoOption.php b/app/Models/KontoOption.php deleted file mode 100644 index 2193624..0000000 --- a/app/Models/KontoOption.php +++ /dev/null @@ -1,14 +0,0 @@ -hasOne(PaymentPlan::class, 'id', 'payment_plan_id'); - } -} diff --git a/app/Models/Plan.php b/app/Models/Plan.php new file mode 100644 index 0000000..e91899c --- /dev/null +++ b/app/Models/Plan.php @@ -0,0 +1,10 @@ +konto_title)) { + // if (isset($user->konto_title)) { - $konto = Konto::create([ - 'konto_title' => $user->konto_title, - 'konto_gender' => $user->konto_gender, - 'konto_company' => $user->konto_company, - 'konto_uid_number' => $user->konto_uid_number, - 'konto_location' => $user->konto_location, - 'konto_plz' => $user->konto_plz, - 'konto_agb_akzeptiert' => $user->konto_agb_akzeptiert, - 'konto_country' => $user->konto_country, - 'konto_address' => $user->konto_address, - 'konto_first_name' => $user->konto_first_name, - 'konto_last_name' => $user->konto_last_name, - 'konto_email' => $user->konto_email, - 'konto_phone' => $user->konto_phone, - ]); - $user->konto_id = $konto->id; + // $konto = Konto::create([ + // 'konto_title' => $user->konto_title, + // 'konto_gender' => $user->konto_gender, + // 'konto_company' => $user->konto_company, + // 'konto_uid_number' => $user->konto_uid_number, + // 'konto_location' => $user->konto_location, + // 'konto_plz' => $user->konto_plz, + // 'konto_agb_akzeptiert' => $user->konto_agb_akzeptiert, + // 'konto_country' => $user->konto_country, + // 'konto_address' => $user->konto_address, + // 'konto_first_name' => $user->konto_first_name, + // 'konto_last_name' => $user->konto_last_name, + // 'konto_email' => $user->konto_email, + // 'konto_phone' => $user->konto_phone, + // ]); + // $user->konto_id = $konto->id; - unset($user->konto_title); - unset($user->konto_gender); - unset($user->konto_company); - unset($user->konto_uid_number); - unset($user->konto_location); - unset($user->konto_plz); - unset($user->konto_agb_akzeptiert); - unset($user->konto_country); - unset($user->konto_address); - unset($user->konto_first_name); - unset($user->konto_last_name); - unset($user->konto_email); - unset($user->konto_phone); - } - $user->app_verified_at = now(); - $user->email_verified_at = now(); - $user->assignRole('gutachter'); - }); + // unset($user->konto_title); + // unset($user->konto_gender); + // unset($user->konto_company); + // unset($user->konto_uid_number); + // unset($user->konto_location); + // unset($user->konto_plz); + // unset($user->konto_agb_akzeptiert); + // unset($user->konto_country); + // unset($user->konto_address); + // unset($user->konto_first_name); + // unset($user->konto_last_name); + // unset($user->konto_email); + // unset($user->konto_phone); + // } + // $user->app_verified_at = now(); + // $user->email_verified_at = now(); + // $user->assignRole('gutachter'); + // }); + } + + public function konto(): HasOne + { + return $this->hasOne(Konto::class, 'id', 'konto_id'); } public function getAppAuthenticationSecret(): ?string diff --git a/app/Policies/PlanPolicy.php b/app/Policies/PlanPolicy.php new file mode 100644 index 0000000..b60786f --- /dev/null +++ b/app/Policies/PlanPolicy.php @@ -0,0 +1,70 @@ +can('ViewAny:Plan'); + } + + public function view(AuthUser $authUser, Plan $plan): bool + { + return $authUser->can('View:Plan'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:Plan'); + } + + public function update(AuthUser $authUser, Plan $plan): bool + { + return $authUser->can('Update:Plan'); + } + + public function delete(AuthUser $authUser, Plan $plan): bool + { + return $authUser->can('Delete:Plan'); + } + + public function restore(AuthUser $authUser, Plan $plan): bool + { + return $authUser->can('Restore:Plan'); + } + + public function forceDelete(AuthUser $authUser, Plan $plan): bool + { + return $authUser->can('ForceDelete:Plan'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:Plan'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:Plan'); + } + + public function replicate(AuthUser $authUser, Plan $plan): bool + { + return $authUser->can('Replicate:Plan'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:Plan'); + } + +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index bd2c3df..784fa98 100644 --- a/composer.lock +++ b/composer.lock @@ -4518,16 +4518,16 @@ }, { "name": "paragonie/constant_time_encoding", - "version": "v3.1.2", + "version": "v3.1.3", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "5bd79e0e88e8757f23e757bcedd1e37fa818cf68" + "reference": "d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/5bd79e0e88e8757f23e757bcedd1e37fa818cf68", - "reference": "5bd79e0e88e8757f23e757bcedd1e37fa818cf68", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77", + "reference": "d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77", "shasum": "" }, "require": { @@ -4583,7 +4583,7 @@ "issues": "https://github.com/paragonie/constant_time_encoding/issues", "source": "https://github.com/paragonie/constant_time_encoding" }, - "time": "2025-09-24T01:22:14+00:00" + "time": "2025-09-24T15:06:41+00:00" }, { "name": "phiki/phiki", @@ -10834,16 +10834,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "12.3.8", + "version": "12.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "99e692c6a84708211f7536ba322bbbaef57ac7fc" + "reference": "67e8aed88f93d0e6e1cb7effe1a2dfc2fee6022c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/99e692c6a84708211f7536ba322bbbaef57ac7fc", - "reference": "99e692c6a84708211f7536ba322bbbaef57ac7fc", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/67e8aed88f93d0e6e1cb7effe1a2dfc2fee6022c", + "reference": "67e8aed88f93d0e6e1cb7effe1a2dfc2fee6022c", "shasum": "" }, "require": { @@ -10870,7 +10870,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.3.x-dev" + "dev-main": "12.4.x-dev" } }, "autoload": { @@ -10899,7 +10899,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.3.8" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.4.0" }, "funding": [ { @@ -10919,7 +10919,7 @@ "type": "tidelift" } ], - "time": "2025-09-17T11:31:43+00:00" + "time": "2025-09-24T13:44:41+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/database/factories/KontoFactory.php b/database/factories/KontoFactory.php index b5a2dcb..4a69d28 100644 --- a/database/factories/KontoFactory.php +++ b/database/factories/KontoFactory.php @@ -19,8 +19,7 @@ class KontoFactory extends Factory return [ 'title' => fake()->randomElement(['Architekt:in', 'Ziviltechniker:in']), 'gender' => fake()->randomElement(['Frau', 'Herr']), - 'first_name' => fake()->firstName(), - 'last_name' => fake()->lastName(), + 'name' => fake()->name(), 'company' => fake()->Company(), 'email' => fake()->email(), 'address' => fake()->Address(), diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 584104c..ba9ebd6 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -2,6 +2,7 @@ namespace Database\Factories; +use App\Models\Konto; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; @@ -24,7 +25,9 @@ class UserFactory extends Factory public function definition(): array { return [ + 'gender' => fake()->randomElement(['Frau', 'Herr']), 'name' => fake()->name(), + 'konto_id' => Konto::all()->random()->id, 'email' => fake()->unique()->safeEmail(), 'email_verified_at' => now(), 'password' => static::$password ??= Hash::make('password'), diff --git a/database/migrations/0001_01_01_000000__create_kontos_table.php b/database/migrations/0001_01_01_000000__create_kontos_table.php index 5fd7a02..d47e2f9 100644 --- a/database/migrations/0001_01_01_000000__create_kontos_table.php +++ b/database/migrations/0001_01_01_000000__create_kontos_table.php @@ -15,8 +15,7 @@ return new class extends Migration $table->id(); $table->string('title')->nullable(); $table->string('gender')->nullable(); - $table->string('first_name'); - $table->string('last_name'); + $table->string('name'); $table->string('company'); $table->string('email')->nullable(); $table->string('address')->nullable(); diff --git a/database/migrations/2025_09_06_143006_create_plan_table.php b/database/migrations/2025_09_06_143006_create_plan_table.php index 56f905e..c6167f1 100644 --- a/database/migrations/2025_09_06_143006_create_plan_table.php +++ b/database/migrations/2025_09_06_143006_create_plan_table.php @@ -14,6 +14,7 @@ return new class extends Migration Schema::create('plans', function (Blueprint $table) { $table->id(); $table->string('name')->nullable(); + $table->string('payment')->nullable(); $table->string('description')->nullable(); $table->integer('number_user')->default(1); $table->integer('number_gutachter')->default(1); @@ -27,6 +28,6 @@ return new class extends Migration */ public function down(): void { - Schema::dropIfExists('konto_options'); + Schema::dropIfExists('plans'); } }; diff --git a/database/migrations/2025_09_22_070431_create_payment_table.php b/database/migrations/2025_09_22_070431_create_payment_table.php deleted file mode 100644 index 62900e5..0000000 --- a/database/migrations/2025_09_22_070431_create_payment_table.php +++ /dev/null @@ -1,29 +0,0 @@ -id(); - $table->string('name')->nullable(); - $table->string('description')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('payments'); - } -}; diff --git a/database/migrations/2025_09_24_102157_create_titels_table.php b/database/migrations/2025_09_24_102157_create_titels_table.php deleted file mode 100644 index 9469ea3..0000000 --- a/database/migrations/2025_09_24_102157_create_titels_table.php +++ /dev/null @@ -1,28 +0,0 @@ -id(); - $table->string('name'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('titels'); - } -}; diff --git a/database/migrations/2025_09_24_102930_create_genders_table.php b/database/migrations/2025_09_24_102930_create_genders_table.php deleted file mode 100644 index 8a2fa04..0000000 --- a/database/migrations/2025_09_24_102930_create_genders_table.php +++ /dev/null @@ -1,28 +0,0 @@ -id(); - $table->string('name'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('genders'); - } -}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 9afb630..a2316ff 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -4,6 +4,7 @@ namespace Database\Seeders; use App\Models\Gutachter; use App\Models\Konto; +use App\Models\User; use Illuminate\Database\Seeder; class DatabaseSeeder extends Seeder @@ -17,11 +18,13 @@ class DatabaseSeeder extends Seeder // Gutachter::factory()->create(30); - // $this->call([ - // OrientierungenSeeder::class, - // KontoOptionSeeder::class, - // RolesAndPermissionsSeeder::class, - // ]); + $this->call([ + OrientierungenSeeder::class, + PlansSeeder::class, + RolesAndPermissionsSeeder::class, + ]); + + User::factory()->count(100)->create(); } } diff --git a/database/seeders/KontoOptionSeeder.php b/database/seeders/KontoOptionSeeder.php deleted file mode 100644 index e3d04d3..0000000 --- a/database/seeders/KontoOptionSeeder.php +++ /dev/null @@ -1,31 +0,0 @@ -