diff --git a/app/Models/User.php b/app/Models/User.php index 0f471a2..38c4499 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,6 +2,9 @@ namespace App\Models; +use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthentication; +use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthenticationRecovery; +use Filament\Auth\MultiFactor\Email\Contracts\HasEmailAuthentication; use Filament\Models\Contracts\FilamentUser; use Filament\Panel; use Illuminate\Contracts\Auth\MustVerifyEmail; @@ -9,10 +12,9 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; -use Illuminate\Support\Facades\Log; use Spatie\Permission\Traits\HasRoles; -class User extends Authenticatable implements FilamentUser, MustVerifyEmail +class User extends Authenticatable implements FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasEmailAuthentication, MustVerifyEmail { /** @use HasFactory<\Database\Factories\UserFactory> */ use HasFactory, HasRoles, Notifiable, SoftDeletes; @@ -47,6 +49,8 @@ class User extends Authenticatable implements FilamentUser, MustVerifyEmail protected $hidden = [ 'password', 'remember_token', + 'app_authentication_secret', + 'app_authentication_recovery_codes', ]; /** @@ -60,38 +64,83 @@ class User extends Authenticatable implements FilamentUser, MustVerifyEmail 'email_verified_at' => 'datetime', 'password' => 'hashed', 'app_verified_at' => 'datetime', + 'app_authentication_secret' => 'encrypted', + 'app_authentication_recovery_codes' => 'encrypted:array', + 'has_email_authentication' => 'boolean', ]; } + public function getAppAuthenticationSecret(): ?string + { + // This method should return the user's saved app authentication secret. + + return $this->app_authentication_secret; + } + + public function saveAppAuthenticationSecret(?string $secret): void + { + // This method should save the user's app authentication secret. + + $this->app_authentication_secret = $secret; + $this->save(); + } + + public function getAppAuthenticationHolderName(): string + { + // In a user's authentication app, each account can be represented by a "holder name". + // If the user has multiple accounts in your app, it might be a good idea to use + // their email address as then they are still uniquely identifiable. + + return $this->email; + } + + /** + * @return ?array + */ + public function getAppAuthenticationRecoveryCodes(): ?array + { + // This method should return the user's saved app authentication recovery codes. + + return $this->app_authentication_recovery_codes; + } + + /** + * @param array | null $codes + */ + public function saveAppAuthenticationRecoveryCodes(?array $codes): void + { + // This method should save the user's app authentication recovery codes. + + $this->app_authentication_recovery_codes = $codes; + $this->save(); + } + + public function hasEmailAuthentication(): bool + { + // This method should return true if the user has enabled email authentication. + + return $this->has_email_authentication; + } + + public function toggleEmailAuthentication(bool $condition): void + { + // This method should save whether or not the user has enabled email authentication. + + $this->has_email_authentication = $condition; + $this->save(); + } + public function canAccessPanel(Panel $panel): bool { - Log::info('canAccessPanel'); - return true; } public function canAccessAdminPanel(Panel $panel): bool { - Log::info('canAccessAdminPanel'); - if ($panel->getId() === 'admin') { - return ( - str_ends_with($this->email, '@webwerkstatt.tirol') || - str_ends_with($this->email, '@kammerwest.at') - ) - && $this->hasVerifiedEmail(); + return $this->hasVerifiedEmail(); } return false; } - - public function kammer() - { - return $this->belongsTo(Kammer::class); - } - - public function bundesland() - { - return $this->belongsTo(Bundesland::class); - } } diff --git a/app/Policies/GutachterPolicy.php b/app/Policies/GutachterPolicy.php index b7f97ff..eef38db 100644 --- a/app/Policies/GutachterPolicy.php +++ b/app/Policies/GutachterPolicy.php @@ -1,108 +1,70 @@ can('view_any_gutachters::gutachter'); + return $authUser->can('ViewAny:Gutachter'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, Gutachter $gutachter): bool + public function view(AuthUser $authUser, Gutachter $gutachter): bool { - return $user->can('view_gutachters::gutachter'); + return $authUser->can('View:Gutachter'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return $user->can('create_gutachters::gutachter'); + return $authUser->can('Create:Gutachter'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, Gutachter $gutachter): bool + public function update(AuthUser $authUser, Gutachter $gutachter): bool { - return $user->can('update_gutachters::gutachter'); + return $authUser->can('Update:Gutachter'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, Gutachter $gutachter): bool + public function delete(AuthUser $authUser, Gutachter $gutachter): bool { - return $user->can('delete_gutachters::gutachter'); + return $authUser->can('Delete:Gutachter'); } - /** - * Determine whether the user can bulk delete. - */ - public function deleteAny(User $user): bool + public function restore(AuthUser $authUser, Gutachter $gutachter): bool { - return $user->can('delete_any_gutachters::gutachter'); + return $authUser->can('Restore:Gutachter'); } - /** - * Determine whether the user can permanently delete. - */ - public function forceDelete(User $user, Gutachter $gutachter): bool + public function forceDelete(AuthUser $authUser, Gutachter $gutachter): bool { - return $user->can('force_delete_gutachters::gutachter'); + return $authUser->can('ForceDelete:Gutachter'); } - /** - * Determine whether the user can permanently bulk delete. - */ - public function forceDeleteAny(User $user): bool + public function forceDeleteAny(AuthUser $authUser): bool { - return $user->can('force_delete_any_gutachters::gutachter'); + return $authUser->can('ForceDeleteAny:Gutachter'); } - /** - * Determine whether the user can restore. - */ - public function restore(User $user, Gutachter $gutachter): bool + public function restoreAny(AuthUser $authUser): bool { - return $user->can('restore_gutachters::gutachter'); + return $authUser->can('RestoreAny:Gutachter'); } - /** - * Determine whether the user can bulk restore. - */ - public function restoreAny(User $user): bool + public function replicate(AuthUser $authUser, Gutachter $gutachter): bool { - return $user->can('restore_any_gutachters::gutachter'); + return $authUser->can('Replicate:Gutachter'); } - /** - * Determine whether the user can replicate. - */ - public function replicate(User $user, Gutachter $gutachter): bool + public function reorder(AuthUser $authUser): bool { - return $user->can('replicate_gutachters::gutachter'); + return $authUser->can('Reorder:Gutachter'); } - /** - * Determine whether the user can reorder. - */ - public function reorder(User $user): bool - { - return $user->can('reorder_gutachters::gutachter'); - } -} +} \ No newline at end of file diff --git a/app/Policies/KontoPolicy.php b/app/Policies/KontoPolicy.php index 3e04415..10b28f5 100644 --- a/app/Policies/KontoPolicy.php +++ b/app/Policies/KontoPolicy.php @@ -1,108 +1,70 @@ can('view_any_kontos::konto'); + return $authUser->can('ViewAny:Konto'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, Konto $konto): bool + public function view(AuthUser $authUser, Konto $konto): bool { - return $user->can('view_kontos::konto'); + return $authUser->can('View:Konto'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return $user->can('create_kontos::konto'); + return $authUser->can('Create:Konto'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, Konto $konto): bool + public function update(AuthUser $authUser, Konto $konto): bool { - return $user->can('update_kontos::konto'); + return $authUser->can('Update:Konto'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, Konto $konto): bool + public function delete(AuthUser $authUser, Konto $konto): bool { - return $user->can('delete_kontos::konto'); + return $authUser->can('Delete:Konto'); } - /** - * Determine whether the user can bulk delete. - */ - public function deleteAny(User $user): bool + public function restore(AuthUser $authUser, Konto $konto): bool { - return $user->can('delete_any_kontos::konto'); + return $authUser->can('Restore:Konto'); } - /** - * Determine whether the user can permanently delete. - */ - public function forceDelete(User $user, Konto $konto): bool + public function forceDelete(AuthUser $authUser, Konto $konto): bool { - return $user->can('force_delete_kontos::konto'); + return $authUser->can('ForceDelete:Konto'); } - /** - * Determine whether the user can permanently bulk delete. - */ - public function forceDeleteAny(User $user): bool + public function forceDeleteAny(AuthUser $authUser): bool { - return $user->can('force_delete_any_kontos::konto'); + return $authUser->can('ForceDeleteAny:Konto'); } - /** - * Determine whether the user can restore. - */ - public function restore(User $user, Konto $konto): bool + public function restoreAny(AuthUser $authUser): bool { - return $user->can('restore_kontos::konto'); + return $authUser->can('RestoreAny:Konto'); } - /** - * Determine whether the user can bulk restore. - */ - public function restoreAny(User $user): bool + public function replicate(AuthUser $authUser, Konto $konto): bool { - return $user->can('restore_any_kontos::konto'); + return $authUser->can('Replicate:Konto'); } - /** - * Determine whether the user can replicate. - */ - public function replicate(User $user, Konto $konto): bool + public function reorder(AuthUser $authUser): bool { - return $user->can('replicate_kontos::konto'); + return $authUser->can('Reorder:Konto'); } - /** - * Determine whether the user can reorder. - */ - public function reorder(User $user): bool - { - return $user->can('reorder_kontos::konto'); - } -} +} \ No newline at end of file diff --git a/app/Policies/KontooptionenPolicy.php b/app/Policies/KontooptionenPolicy.php index f79439d..a9c4e1d 100644 --- a/app/Policies/KontooptionenPolicy.php +++ b/app/Policies/KontooptionenPolicy.php @@ -1,108 +1,70 @@ can('view_any_kontooptionens::kontooptionen'); + return $authUser->can('ViewAny:Kontooptionen'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, Kontooptionen $kontooptionen): bool + public function view(AuthUser $authUser, Kontooptionen $kontooptionen): bool { - return $user->can('view_kontooptionens::kontooptionen'); + return $authUser->can('View:Kontooptionen'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return $user->can('create_kontooptionens::kontooptionen'); + return $authUser->can('Create:Kontooptionen'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, Kontooptionen $kontooptionen): bool + public function update(AuthUser $authUser, Kontooptionen $kontooptionen): bool { - return $user->can('update_kontooptionens::kontooptionen'); + return $authUser->can('Update:Kontooptionen'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, Kontooptionen $kontooptionen): bool + public function delete(AuthUser $authUser, Kontooptionen $kontooptionen): bool { - return $user->can('delete_kontooptionens::kontooptionen'); + return $authUser->can('Delete:Kontooptionen'); } - /** - * Determine whether the user can bulk delete. - */ - public function deleteAny(User $user): bool + public function restore(AuthUser $authUser, Kontooptionen $kontooptionen): bool { - return $user->can('delete_any_kontooptionens::kontooptionen'); + return $authUser->can('Restore:Kontooptionen'); } - /** - * Determine whether the user can permanently delete. - */ - public function forceDelete(User $user, Kontooptionen $kontooptionen): bool + public function forceDelete(AuthUser $authUser, Kontooptionen $kontooptionen): bool { - return $user->can('force_delete_kontooptionens::kontooptionen'); + return $authUser->can('ForceDelete:Kontooptionen'); } - /** - * Determine whether the user can permanently bulk delete. - */ - public function forceDeleteAny(User $user): bool + public function forceDeleteAny(AuthUser $authUser): bool { - return $user->can('force_delete_any_kontooptionens::kontooptionen'); + return $authUser->can('ForceDeleteAny:Kontooptionen'); } - /** - * Determine whether the user can restore. - */ - public function restore(User $user, Kontooptionen $kontooptionen): bool + public function restoreAny(AuthUser $authUser): bool { - return $user->can('restore_kontooptionens::kontooptionen'); + return $authUser->can('RestoreAny:Kontooptionen'); } - /** - * Determine whether the user can bulk restore. - */ - public function restoreAny(User $user): bool + public function replicate(AuthUser $authUser, Kontooptionen $kontooptionen): bool { - return $user->can('restore_any_kontooptionens::kontooptionen'); + return $authUser->can('Replicate:Kontooptionen'); } - /** - * Determine whether the user can replicate. - */ - public function replicate(User $user, Kontooptionen $kontooptionen): bool + public function reorder(AuthUser $authUser): bool { - return $user->can('replicate_kontooptionens::kontooptionen'); + return $authUser->can('Reorder:Kontooptionen'); } - /** - * Determine whether the user can reorder. - */ - public function reorder(User $user): bool - { - return $user->can('reorder_kontooptionens::kontooptionen'); - } -} +} \ No newline at end of file diff --git a/app/Policies/PermissionPolicy.php b/app/Policies/PermissionPolicy.php index 7a8a4e4..3f330ed 100644 --- a/app/Policies/PermissionPolicy.php +++ b/app/Policies/PermissionPolicy.php @@ -1,108 +1,70 @@ can('view_any_permissions::permission'); + return $authUser->can('ViewAny:Permission'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, Permission $permission): bool + public function view(AuthUser $authUser, Permission $permission): bool { - return $user->can('view_permissions::permission'); + return $authUser->can('View:Permission'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return $user->can('create_permissions::permission'); + return $authUser->can('Create:Permission'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, Permission $permission): bool + public function update(AuthUser $authUser, Permission $permission): bool { - return $user->can('update_permissions::permission'); + return $authUser->can('Update:Permission'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, Permission $permission): bool + public function delete(AuthUser $authUser, Permission $permission): bool { - return $user->can('delete_permissions::permission'); + return $authUser->can('Delete:Permission'); } - /** - * Determine whether the user can bulk delete. - */ - public function deleteAny(User $user): bool + public function restore(AuthUser $authUser, Permission $permission): bool { - return $user->can('delete_any_permissions::permission'); + return $authUser->can('Restore:Permission'); } - /** - * Determine whether the user can permanently delete. - */ - public function forceDelete(User $user, Permission $permission): bool + public function forceDelete(AuthUser $authUser, Permission $permission): bool { - return $user->can('force_delete_permissions::permission'); + return $authUser->can('ForceDelete:Permission'); } - /** - * Determine whether the user can permanently bulk delete. - */ - public function forceDeleteAny(User $user): bool + public function forceDeleteAny(AuthUser $authUser): bool { - return $user->can('force_delete_any_permissions::permission'); + return $authUser->can('ForceDeleteAny:Permission'); } - /** - * Determine whether the user can restore. - */ - public function restore(User $user, Permission $permission): bool + public function restoreAny(AuthUser $authUser): bool { - return $user->can('restore_permissions::permission'); + return $authUser->can('RestoreAny:Permission'); } - /** - * Determine whether the user can bulk restore. - */ - public function restoreAny(User $user): bool + public function replicate(AuthUser $authUser, Permission $permission): bool { - return $user->can('restore_any_permissions::permission'); + return $authUser->can('Replicate:Permission'); } - /** - * Determine whether the user can replicate. - */ - public function replicate(User $user, Permission $permission): bool + public function reorder(AuthUser $authUser): bool { - return $user->can('replicate_permissions::permission'); + return $authUser->can('Reorder:Permission'); } - /** - * Determine whether the user can reorder. - */ - public function reorder(User $user): bool - { - return $user->can('reorder_permissions::permission'); - } -} +} \ No newline at end of file diff --git a/app/Policies/RolePolicy.php b/app/Policies/RolePolicy.php index ec0381d..a2a3263 100644 --- a/app/Policies/RolePolicy.php +++ b/app/Policies/RolePolicy.php @@ -1,108 +1,70 @@ can('view_any_role'); + return $authUser->can('ViewAny:Role'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, Role $role): bool + public function view(AuthUser $authUser, Role $role): bool { - return $user->can('view_role'); + return $authUser->can('View:Role'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return $user->can('create_role'); + return $authUser->can('Create:Role'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, Role $role): bool + public function update(AuthUser $authUser, Role $role): bool { - return $user->can('update_role'); + return $authUser->can('Update:Role'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, Role $role): bool + public function delete(AuthUser $authUser, Role $role): bool { - return $user->can('delete_role'); + return $authUser->can('Delete:Role'); } - /** - * Determine whether the user can bulk delete. - */ - public function deleteAny(User $user): bool + public function restore(AuthUser $authUser, Role $role): bool { - return $user->can('delete_any_role'); + return $authUser->can('Restore:Role'); } - /** - * Determine whether the user can permanently delete. - */ - public function forceDelete(User $user, Role $role): bool + public function forceDelete(AuthUser $authUser, Role $role): bool { - return $user->can('{{ ForceDelete }}'); + return $authUser->can('ForceDelete:Role'); } - /** - * Determine whether the user can permanently bulk delete. - */ - public function forceDeleteAny(User $user): bool + public function forceDeleteAny(AuthUser $authUser): bool { - return $user->can('{{ ForceDeleteAny }}'); + return $authUser->can('ForceDeleteAny:Role'); } - /** - * Determine whether the user can restore. - */ - public function restore(User $user, Role $role): bool + public function restoreAny(AuthUser $authUser): bool { - return $user->can('{{ Restore }}'); + return $authUser->can('RestoreAny:Role'); } - /** - * Determine whether the user can bulk restore. - */ - public function restoreAny(User $user): bool + public function replicate(AuthUser $authUser, Role $role): bool { - return $user->can('{{ RestoreAny }}'); + return $authUser->can('Replicate:Role'); } - /** - * Determine whether the user can replicate. - */ - public function replicate(User $user, Role $role): bool + public function reorder(AuthUser $authUser): bool { - return $user->can('{{ Replicate }}'); + return $authUser->can('Reorder:Role'); } - /** - * Determine whether the user can reorder. - */ - public function reorder(User $user): bool - { - return $user->can('{{ Reorder }}'); - } -} +} \ No newline at end of file diff --git a/app/Policies/UserPolicy.php b/app/Policies/UserPolicy.php index a64e950..10cdce3 100644 --- a/app/Policies/UserPolicy.php +++ b/app/Policies/UserPolicy.php @@ -2,143 +2,66 @@ namespace App\Policies; -use App\Models\User; - +use Illuminate\Foundation\Auth\User as AuthUser; use Illuminate\Auth\Access\HandlesAuthorization; class UserPolicy { use HandlesAuthorization; - - /** - * Determine whether the user can view any models. - * - * @param \App\Models\User $user - * @return bool - */ - public function viewAny(User $user): bool + + public function viewAny(AuthUser $authUser): bool { - return $user->can('view_any_users::user'); + return $authUser->can('ViewAny:User'); } - /** - * Determine whether the user can view the model. - * - * @param \App\Models\User $user - * @return bool - */ - public function view(User $user): bool + public function view(AuthUser $authUser): bool { - return $user->can('view_users::user'); + return $authUser->can('View:User'); } - /** - * Determine whether the user can create models. - * - * @param \App\Models\User $user - * @return bool - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return $user->can('create_users::user'); + return $authUser->can('Create:User'); } - /** - * Determine whether the user can update the model. - * - * @param \App\Models\User $user - * @return bool - */ - public function update(User $user): bool + public function update(AuthUser $authUser): bool { - return $user->can('update_users::user'); + return $authUser->can('Update:User'); } - /** - * Determine whether the user can delete the model. - * - * @param \App\Models\User $user - * @return bool - */ - public function delete(User $user): bool + public function delete(AuthUser $authUser): bool { - return $user->can('delete_users::user'); + return $authUser->can('Delete:User'); } - /** - * Determine whether the user can bulk delete. - * - * @param \App\Models\User $user - * @return bool - */ - public function deleteAny(User $user): bool + public function restore(AuthUser $authUser): bool { - return $user->can('delete_any_users::user'); + return $authUser->can('Restore:User'); } - /** - * Determine whether the user can permanently delete. - * - * @param \App\Models\User $user - * @return bool - */ - public function forceDelete(User $user): bool + public function forceDelete(AuthUser $authUser): bool { - return $user->can('force_delete_users::user'); + return $authUser->can('ForceDelete:User'); } - /** - * Determine whether the user can permanently bulk delete. - * - * @param \App\Models\User $user - * @return bool - */ - public function forceDeleteAny(User $user): bool + public function forceDeleteAny(AuthUser $authUser): bool { - return $user->can('force_delete_any_users::user'); + return $authUser->can('ForceDeleteAny:User'); } - /** - * Determine whether the user can restore. - * - * @param \App\Models\User $user - * @return bool - */ - public function restore(User $user): bool + public function restoreAny(AuthUser $authUser): bool { - return $user->can('restore_users::user'); + return $authUser->can('RestoreAny:User'); } - /** - * Determine whether the user can bulk restore. - * - * @param \App\Models\User $user - * @return bool - */ - public function restoreAny(User $user): bool + public function replicate(AuthUser $authUser): bool { - return $user->can('restore_any_users::user'); + return $authUser->can('Replicate:User'); } - /** - * Determine whether the user can bulk restore. - * - * @param \App\Models\User $user - * @return bool - */ - public function replicate(User $user): bool + public function reorder(AuthUser $authUser): bool { - return $user->can('replicate_users::user'); + return $authUser->can('Reorder:User'); } - /** - * Determine whether the user can reorder. - * - * @param \App\Models\User $user - * @return bool - */ - public function reorder(User $user): bool - { - return $user->can('reorder_users::user'); - } -} +} \ No newline at end of file diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 45059ae..3c5fec7 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -23,9 +23,9 @@ class AppServiceProvider extends ServiceProvider */ public function boot(): void { - FilamentColor::register([ - 'primary' => '#47847f', - ]); + // FilamentColor::register([ + // 'primary' => '#733e0a', + // ]); FilamentView::registerRenderHook( PanelsRenderHook::AUTH_LOGIN_FORM_BEFORE, fn (): View => view('login-links'), diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index a889e68..c9901db 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -7,6 +7,8 @@ use App\Http\Middleware\AppUserVerifiedMiddleware; use Awcodes\LightSwitch\Enums\Alignment; use Awcodes\LightSwitch\LightSwitchPlugin; use BezhanSalleh\FilamentShield\FilamentShieldPlugin; +use Filament\Auth\MultiFactor\App\AppAuthentication; +use Filament\Auth\MultiFactor\Email\EmailAuthentication; use Filament\Http\Middleware\Authenticate; use Filament\Http\Middleware\AuthenticateSession; use Filament\Http\Middleware\DisableBladeIconComponents; @@ -26,6 +28,7 @@ use Illuminate\Session\Middleware\StartSession; use Illuminate\Support\Facades\Blade; use Illuminate\View\Middleware\ShareErrorsFromSession; use Swis\Filament\Backgrounds\FilamentBackgroundsPlugin; +use Swis\Filament\Backgrounds\ImageProviders\MyImages; class AdminPanelProvider extends PanelProvider { @@ -35,11 +38,22 @@ class AdminPanelProvider extends PanelProvider ->id('admin') ->path('') ->login() + ->registration() + ->passwordReset() + ->emailVerification() + ->emailChangeVerification() + ->profile() ->default() ->renderHook( PanelsRenderHook::GLOBAL_SEARCH_BEFORE, fn (): string => auth()->user()->hasRole('gutachter_switch') ? Blade::render('@livewire(\'tenancy-switch\')') : false ) + ->multiFactorAuthentication([ + EmailAuthentication::make(), + AppAuthentication::make() + ->recoverable(), + ]) + // ], isRequired: true) ->maxContentWidth(Width::ScreenExtraLarge) // ->sidebarCollapsibleOnDesktop() // ->font('Open Sans') @@ -74,10 +88,13 @@ class AdminPanelProvider extends PanelProvider Authenticate::class, ])->plugins([ FilamentShieldPlugin::make(), - FilamentBackgroundsPlugin::make(), + FilamentBackgroundsPlugin::make() + ->imageProvider( + MyImages::make() + ->directory('images/backgrounds') + ), LightSwitchPlugin::make()->position(Alignment::TopCenter), // HooksHelperPlugin::make(), - ]); } } diff --git a/composer.json b/composer.json index d0337c4..2a86c95 100644 --- a/composer.json +++ b/composer.json @@ -3,20 +3,22 @@ "name": "laravel/laravel", "type": "project", "description": "The skeleton application for the Laravel framework.", - "keywords": ["laravel", "framework"], + "keywords": [ + "laravel", + "framework" + ], "license": "MIT", "require": { "php": "^8.3", "agencetwogether/hookshelper": "^0.0.2", "awcodes/light-switch": "^2.0", - "bezhansalleh/filament-shield": "^4.0@beta", + "bezhansalleh/filament-shield": "*", "filament/filament": "^4.0", "laravel/framework": "^12.0", "laravel/tinker": "^2.10.1", "livewire/livewire": "^3.6", "mallardduck/blade-lucide-icons": "^1.23", "spatie/laravel-login-link": "^1.6", - "spatie/laravel-multitenancy": "^4.0", "swisnl/filament-backgrounds": "^2.0", "ysfkaya/filament-phone-input": "^4.0@beta" }, diff --git a/composer.lock b/composer.lock index 2e37842..d4e6797 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bad50230eed48fcdbd195c9d49310cfa", + "content-hash": "86131fc6e2814af73859860025a45afe", "packages": [ { "name": "agencetwogether/hookshelper", @@ -219,24 +219,103 @@ "time": "2025-08-25T13:58:07+00:00" }, { - "name": "bezhansalleh/filament-shield", - "version": "4.0.0-beta2", + "name": "bezhansalleh/filament-plugin-essentials", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/bezhanSalleh/filament-shield.git", - "reference": "a1ff497383cfbbe9107cb7991859d94506a471d8" + "url": "https://github.com/bezhanSalleh/filament-plugin-essentials.git", + "reference": "fb4656c661270133b1b1c4297616745e4d586ca7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bezhanSalleh/filament-shield/zipball/a1ff497383cfbbe9107cb7991859d94506a471d8", - "reference": "a1ff497383cfbbe9107cb7991859d94506a471d8", + "url": "https://api.github.com/repos/bezhanSalleh/filament-plugin-essentials/zipball/fb4656c661270133b1b1c4297616745e4d586ca7", + "reference": "fb4656c661270133b1b1c4297616745e4d586ca7", "shasum": "" }, "require": { "filament/filament": "^4.0", - "filament/upgrade": "^4.0", "illuminate/contracts": "^11.28|^12.0", "php": "^8.2", + "spatie/laravel-package-tools": "^1.9" + }, + "require-dev": { + "larastan/larastan": "^2.9||^3.0", + "laravel/pint": "^1.14", + "nunomaduro/collision": "^8.1.1||^7.10.0", + "orchestra/testbench": "^10.0.0||^9.0.0", + "pestphp/pest": "^3.0", + "pestphp/pest-plugin-arch": "^3.0", + "pestphp/pest-plugin-laravel": "^3.0", + "pestphp/pest-plugin-type-coverage": "^3.5", + "phpstan/extension-installer": "^1.3||^2.0", + "phpstan/phpstan-deprecation-rules": "^1.1||^2.0", + "phpstan/phpstan-phpunit": "^1.3||^2.0", + "rector/rector": "^2.1", + "spatie/laravel-ray": "^1.40" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "BezhanSalleh\\PluginEssentials\\PluginEssentialsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "BezhanSalleh\\PluginEssentials\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bezhan Salleh", + "email": "bezhan_salleh@yahoo.com", + "role": "Developer" + } + ], + "description": "A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster", + "homepage": "https://github.com/bezhansalleh/filament-plugin-essentials", + "keywords": [ + "Bezhan Salleh", + "filament-plugin-essentials", + "laravel" + ], + "support": { + "issues": "https://github.com/bezhanSalleh/filament-plugin-essentials/issues", + "source": "https://github.com/bezhanSalleh/filament-plugin-essentials/tree/1.0.0" + }, + "funding": [ + { + "url": "https://github.com/bezhanSalleh", + "type": "github" + } + ], + "time": "2025-08-31T06:50:44+00:00" + }, + { + "name": "bezhansalleh/filament-shield", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/bezhanSalleh/filament-shield.git", + "reference": "c58355c913dcf987ce6e09294544ade597454dca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bezhanSalleh/filament-shield/zipball/c58355c913dcf987ce6e09294544ade597454dca", + "reference": "c58355c913dcf987ce6e09294544ade597454dca", + "shasum": "" + }, + "require": { + "bezhansalleh/filament-plugin-essentials": "^1.0", + "filament/filament": "^4.0", + "illuminate/contracts": "^11.28|^12.0", + "illuminate/support": "*", + "php": "^8.2", "spatie/laravel-package-tools": "^1.9", "spatie/laravel-permission": "^6.0" }, @@ -254,6 +333,7 @@ "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", "phpunit/phpunit": "^10.1|^11.0", + "rector/rector": "^2.1", "spatie/laravel-ray": "^1.40" }, "type": "library", @@ -300,7 +380,7 @@ ], "support": { "issues": "https://github.com/bezhanSalleh/filament-shield/issues", - "source": "https://github.com/bezhanSalleh/filament-shield/tree/4.0.0-beta2" + "source": "https://github.com/bezhanSalleh/filament-shield/tree/4.0.0" }, "funding": [ { @@ -308,7 +388,7 @@ "type": "github" } ], - "time": "2025-07-10T22:46:16+00:00" + "time": "2025-09-07T07:11:27+00:00" }, { "name": "blade-ui-kit/blade-heroicons", @@ -1623,53 +1703,6 @@ }, "time": "2025-09-04T14:12:44+00:00" }, - { - "name": "filament/upgrade", - "version": "v4.0.7", - "source": { - "type": "git", - "url": "https://github.com/filamentphp/upgrade.git", - "reference": "21a3da29b7ebc4e85372b9a6dd39e391cbc47fdb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/filamentphp/upgrade/zipball/21a3da29b7ebc4e85372b9a6dd39e391cbc47fdb", - "reference": "21a3da29b7ebc4e85372b9a6dd39e391cbc47fdb", - "shasum": "" - }, - "require": { - "nunomaduro/termwind": "^2.0", - "php": "^8.2", - "rector/rector": "^2.0" - }, - "bin": [ - "bin/filament-v4" - ], - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Filament\\Upgrade\\UpgradeServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Filament\\Upgrade\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Upgrade Filament v3 code to Filament v4.", - "homepage": "https://github.com/filamentphp/filament", - "support": { - "issues": "https://github.com/filamentphp/filament/issues", - "source": "https://github.com/filamentphp/filament" - }, - "time": "2025-09-02T11:01:30+00:00" - }, { "name": "filament/widgets", "version": "v4.0.7", @@ -3836,16 +3869,16 @@ }, { "name": "nesbot/carbon", - "version": "3.10.2", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "76b5c07b8a9d2025ed1610e14cef1f3fd6ad2c24" + "reference": "8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/76b5c07b8a9d2025ed1610e14cef1f3fd6ad2c24", - "reference": "76b5c07b8a9d2025ed1610e14cef1f3fd6ad2c24", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f", + "reference": "8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f", "shasum": "" }, "require": { @@ -3863,13 +3896,13 @@ "require-dev": { "doctrine/dbal": "^3.6.3 || ^4.0", "doctrine/orm": "^2.15.2 || ^3.0", - "friendsofphp/php-cs-fixer": "^3.75.0", + "friendsofphp/php-cs-fixer": "^v3.87.1", "kylekatarnls/multi-tester": "^2.5.3", "phpmd/phpmd": "^2.15.0", "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^2.1.17", - "phpunit/phpunit": "^10.5.46", - "squizlabs/php_codesniffer": "^3.13.0" + "phpstan/phpstan": "^2.1.22", + "phpunit/phpunit": "^10.5.53", + "squizlabs/php_codesniffer": "^3.13.4" }, "bin": [ "bin/carbon" @@ -3937,7 +3970,7 @@ "type": "tidelift" } ], - "time": "2025-08-02T09:36:06+00:00" + "time": "2025-09-06T13:39:36+00:00" }, { "name": "nette/php-generator", @@ -4542,64 +4575,6 @@ ], "time": "2025-08-21T11:53:16+00:00" }, - { - "name": "phpstan/phpstan", - "version": "2.1.22", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "41600c8379eb5aee63e9413fe9e97273e25d57e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/41600c8379eb5aee63e9413fe9e97273e25d57e4", - "reference": "41600c8379eb5aee63e9413fe9e97273e25d57e4", - "shasum": "" - }, - "require": { - "php": "^7.4|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan - PHP Static Analysis Tool", - "keywords": [ - "dev", - "static analysis" - ], - "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" - }, - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", - "type": "github" - } - ], - "time": "2025-08-04T19:17:37+00:00" - }, { "name": "pragmarx/google2fa", "version": "v8.0.3", @@ -5479,66 +5454,6 @@ }, "time": "2025-09-04T20:59:21+00:00" }, - { - "name": "rector/rector", - "version": "2.1.5", - "source": { - "type": "git", - "url": "https://github.com/rectorphp/rector.git", - "reference": "1cd6abfb5976fd4ed728d5b73ebd67c7c810cd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/1cd6abfb5976fd4ed728d5b73ebd67c7c810cd88", - "reference": "1cd6abfb5976fd4ed728d5b73ebd67c7c810cd88", - "shasum": "" - }, - "require": { - "php": "^7.4|^8.0", - "phpstan/phpstan": "^2.1.18" - }, - "conflict": { - "rector/rector-doctrine": "*", - "rector/rector-downgrade-php": "*", - "rector/rector-phpunit": "*", - "rector/rector-symfony": "*" - }, - "suggest": { - "ext-dom": "To manipulate phpunit.xml via the custom-rule command" - }, - "bin": [ - "bin/rector" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Instant Upgrade and Automated Refactoring of any PHP code", - "homepage": "https://getrector.com/", - "keywords": [ - "automation", - "dev", - "migration", - "refactoring" - ], - "support": { - "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/2.1.5" - }, - "funding": [ - { - "url": "https://github.com/tomasvotruba", - "type": "github" - } - ], - "time": "2025-09-04T14:19:07+00:00" - }, { "name": "ryangjchandler/blade-capture-directive", "version": "v1.1.0", @@ -5819,85 +5734,6 @@ }, "time": "2025-04-16T13:42:34+00:00" }, - { - "name": "spatie/laravel-multitenancy", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-multitenancy.git", - "reference": "7b43b33a4e4194157949470a04effc64b8bac2a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-multitenancy/zipball/7b43b33a4e4194157949470a04effc64b8bac2a3", - "reference": "7b43b33a4e4194157949470a04effc64b8bac2a3", - "shasum": "" - }, - "require": { - "illuminate/support": "^11.0|^12.0", - "php": "^8.2", - "spatie/laravel-package-tools": "^1.9" - }, - "require-dev": { - "laravel/legacy-factories": "^1.0.4", - "laravel/octane": "^2.5|dev-develop", - "laravel/serializable-closure": "^1.1|^2.0", - "mockery/mockery": "^1.4", - "orchestra/testbench": "^9.0|^10.0", - "pestphp/pest": "^2.34|^3.7", - "spatie/valuestore": "^1.2" - }, - "type": "library", - "extra": { - "laravel": { - "aliases": { - "Multitenancy": "Spatie\\Multitenancy\\MultitenancyFacade" - }, - "providers": [ - "Spatie\\Multitenancy\\MultitenancyServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Spatie\\Multitenancy\\": "src", - "Spatie\\Multitenancy\\Database\\Factories\\": "database/factories" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "http://spatie.be", - "role": "Developer" - } - ], - "description": "Make your Laravel app usable by multiple tenants", - "homepage": "https://github.com/spatie/laravel-multitenancy", - "keywords": [ - "laravel-multitenancy", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/laravel-multitenancy/issues", - "source": "https://github.com/spatie/laravel-multitenancy/tree/4.0.5" - }, - "funding": [ - { - "url": "https://spatie.be/open-source/support-us", - "type": "custom" - }, - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2025-05-12T09:56:03+00:00" - }, { "name": "spatie/laravel-package-tools", "version": "1.92.7", @@ -12396,7 +12232,6 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "bezhansalleh/filament-shield": 10, "ysfkaya/filament-phone-input": 10 }, "prefer-stable": true, diff --git a/config/filament-shield.php b/config/filament-shield.php index 5ff2584..44a15af 100644 --- a/config/filament-shield.php +++ b/config/filament-shield.php @@ -1,92 +1,261 @@ [ - 'should_register_navigation' => true, 'slug' => 'shield/roles', - 'navigation_sort' => -1, - 'navigation_badge' => true, - 'navigation_group' => true, - 'sub_navigation_position' => null, - 'is_globally_searchable' => false, 'show_model_path' => true, - 'is_scoped_to_tenant' => true, 'cluster' => null, + 'tabs' => [ + 'pages' => true, + 'widgets' => true, + 'resources' => true, + 'custom_permissions' => false, + ], ], + /* + |-------------------------------------------------------------------------- + | Multi-Tenancy + |-------------------------------------------------------------------------- + | + | When your application supports teams, Shield will automatically detect + | and configure the tenant model during setup. This enables tenant-scoped + | roles and permissions throughout your application. + | + */ + 'tenant_model' => null, - 'auth_provider_model' => [ - 'fqcn' => 'App\\Models\\User', - ], + /* + |-------------------------------------------------------------------------- + | User Model + |-------------------------------------------------------------------------- + | + | This value contains the class name of your user model. This model will + | be used for role assignments and must implement the HasRoles trait + | provided by the Spatie\Permission package. + | + */ + + 'auth_provider_model' => 'App\\Models\\User', + + /* + |-------------------------------------------------------------------------- + | Super Admin + |-------------------------------------------------------------------------- + | + | Here you may define a super admin that has unrestricted access to your + | application. You can choose to implement this via Laravel's gate system + | or as a traditional role with all permissions explicitly assigned. + | + */ 'super_admin' => [ 'enabled' => true, 'name' => 'super_admin', 'define_via_gate' => false, - 'intercept_gate' => 'before', // after + 'intercept_gate' => 'before', ], + /* + |-------------------------------------------------------------------------- + | Panel User + |-------------------------------------------------------------------------- + | + | When enabled, Shield will create a basic panel user role that can be + | assigned to users who should have access to your Filament panels but + | don't need any specific permissions beyond basic authentication. + | + */ + 'panel_user' => [ 'enabled' => true, 'name' => 'panel_user', ], - 'permission_prefixes' => [ - 'resource' => [ - 'view', - 'view_any', + /* + |-------------------------------------------------------------------------- + | Permission Builder + |-------------------------------------------------------------------------- + | + | You can customize how permission keys are generated to match your + | preferred naming convention and organizational standards. Shield uses + | these settings when creating permission names from your resources. + | + | Supported formats: snake, kebab, pascal, camel, upper_snake, lower_snake + | + */ + + 'permissions' => [ + 'separator' => ':', + 'case' => 'pascal', + 'generate' => true, + ], + + /* + |-------------------------------------------------------------------------- + | Policies + |-------------------------------------------------------------------------- + | + | Shield can automatically generate Laravel policies for your resources. + | When merge is enabled, the methods below will be combined with any + | resource-specific methods you define in the resources section. + | + */ + + 'policies' => [ + 'path' => app_path('Policies'), + 'merge' => true, + 'generate' => true, + 'methods' => [ + 'viewAny', 'view', 'create', 'update', 'delete', 'restore', + 'forceDelete', 'forceDeleteAny', 'restoreAny', 'replicate', 'reorder', + ], + 'single_parameter_methods' => [ + 'viewAny', 'create', - 'update', - 'restore', - 'restore_any', - 'replicate', + 'deleteAny', + 'forceDeleteAny', + 'restoreAny', 'reorder', - 'delete', - 'delete_any', - 'force_delete', - 'force_delete_any', ], - - 'page' => 'page', - 'widget' => 'widget', ], - 'entities' => [ - 'pages' => true, - 'widgets' => true, - 'resources' => true, - 'custom_permissions' => false, + /* + |-------------------------------------------------------------------------- + | Localization + |-------------------------------------------------------------------------- + | + | Shield supports multiple languages out of the box. When enabled, you + | can provide translated labels for permissions and roles to create a + | more localized experience for your international users. + | + */ + + 'localization' => [ + 'enabled' => false, + 'key' => 'filament-shield::filament-shield', ], - 'generator' => [ - 'option' => 'policies_and_permissions', - 'policy_directory' => 'Policies', - 'policy_namespace' => 'Policies', - ], + /* + |-------------------------------------------------------------------------- + | Resources + |-------------------------------------------------------------------------- + | + | Here you can fine-tune permissions for specific Filament resources. + | Use the 'manage' array to override the default policy methods for + | individual resources, giving you granular control over permissions. + | + */ - 'exclude' => [ - 'enabled' => true, - - 'pages' => [ - 'Dashboard', + 'resources' => [ + 'subject' => 'model', + 'manage' => [ + \BezhanSalleh\FilamentShield\Resources\Roles\RoleResource::class => [ + 'viewAny', + 'view', + 'create', + 'update', + 'delete', + ], ], - - 'widgets' => [ - 'AccountWidget', 'FilamentInfoWidget', + 'exclude' => [ + // ], - - 'resources' => [], ], + /* + |-------------------------------------------------------------------------- + | Pages + |-------------------------------------------------------------------------- + | + | Most Filament pages only require view permissions. Pages listed in the + | exclude array will be skipped during permission generation and won't + | appear in your role management interface. + | + */ + + 'pages' => [ + 'subject' => 'class', + 'prefix' => 'view', + 'exclude' => [ + \Filament\Pages\Dashboard::class, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Widgets + |-------------------------------------------------------------------------- + | + | Like pages, widgets typically only need view permissions. Add widgets + | to the exclude array if you don't want them to appear in your role + | management interface. + | + */ + + 'widgets' => [ + 'subject' => 'class', + 'prefix' => 'view', + 'exclude' => [ + \Filament\Widgets\AccountWidget::class, + \Filament\Widgets\FilamentInfoWidget::class, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Permissions + |-------------------------------------------------------------------------- + | + | Sometimes you need permissions that don't map to resources, pages, or + | widgets. Define any custom permissions here and they'll be available + | when editing roles in your application. + | + */ + + 'custom_permissions' => [], + + /* + |-------------------------------------------------------------------------- + | Entity Discovery + |-------------------------------------------------------------------------- + | + | By default, Shield only looks for entities in your default Filament + | panel. Enable these options if you're using multiple panels and want + | Shield to discover entities across all of them. + | + */ + 'discovery' => [ 'discover_all_resources' => false, 'discover_all_widgets' => false, 'discover_all_pages' => false, ], - 'register_role_policy' => [ - 'enabled' => true, - ], + /* + |-------------------------------------------------------------------------- + | Role Policy + |-------------------------------------------------------------------------- + | + | Shield can automatically register a policy for role management itself. + | This lets you control who can manage roles using Laravel's built-in + | authorization system. Requires a RolePolicy class in your app. + | + */ + + 'register_role_policy' => true, ]; diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 3b6b83c..9213173 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -13,13 +13,18 @@ return new class extends Migration { Schema::create('users', function (Blueprint $table) { $table->id(); - $table->foreignId('konto_id')->constrained()->cascadeOnDelete(); + $table->foreignId('konto_id')->constrained()->cascadeOnDelete()->default(0); $table->string('gender')->nullable(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->boolean('super_admin')->default(0); + + $table->text('app_authentication_secret')->nullable(); + $table->text('app_authentication_recovery_codes')->nullable(); + $table->boolean('has_email_authentication')->default(false); + $table->rememberToken(); $table->timestamp('app_verified_at')->nullable(); $table->timestamp('deleted_at')->nullable(); diff --git a/public/images/backgrounds/b1.jpg b/public/images/backgrounds/b1.jpg new file mode 100644 index 0000000..5856443 Binary files /dev/null and b/public/images/backgrounds/b1.jpg differ diff --git a/public/images/backgrounds/b2.jpg b/public/images/backgrounds/b2.jpg new file mode 100644 index 0000000..5b4ed98 Binary files /dev/null and b/public/images/backgrounds/b2.jpg differ diff --git a/public/images/backgrounds/b3.jpg b/public/images/backgrounds/b3.jpg new file mode 100644 index 0000000..d6d67f7 Binary files /dev/null and b/public/images/backgrounds/b3.jpg differ diff --git a/public/images/backgrounds/b4.jpg b/public/images/backgrounds/b4.jpg new file mode 100644 index 0000000..56929b7 Binary files /dev/null and b/public/images/backgrounds/b4.jpg differ diff --git a/public/images/backgrounds/b5.jpg b/public/images/backgrounds/b5.jpg new file mode 100644 index 0000000..2987505 Binary files /dev/null and b/public/images/backgrounds/b5.jpg differ diff --git a/resources/views/login-text.blade.php b/resources/views/login-text.blade.php index a709c2c..f8ae361 100644 --- a/resources/views/login-text.blade.php +++ b/resources/views/login-text.blade.php @@ -1,5 +1,9 @@ -
- Durch die Parifizierung oder Nutzwertberechnung wird im Österreichischen Wohnungseigentumsrecht das Verhältnis der - Eigentumsanteile der einzelnen Miteigentümer eines Hauses, an dem Wohnungseigentum begründet ist, untereinander - bestimmt. +
+

+ Mit diesem Programm wird die Parifizierung oder Nutzwertberechnung welche im Österreichischen + Wohnungseigentumsrecht das Verhältnis der Eigentumsanteile der einzelnen Miteigentümer eines Hauses, an dem + Wohnungseigentum begründet, anhand von importierten Daten mit Hilfe von konfigurierbaren Kriterien und Methoden + berechnet und bestimmt. +

diff --git a/setup.sh b/setup.sh index 005a5a5..4a2acff 100755 --- a/setup.sh +++ b/setup.sh @@ -45,7 +45,7 @@ case "$1" in echo "4 => chown -R apache:apache ." echo "5 => a storage:link" echo "6 => a filament:assets . copy to prod" - echo "7 => a shield:setup with tenancy" + echo "7 => a shield:setup" echo "--------------------------" echo "" ;; diff --git a/vite.config.js b/vite.config.js index 29fbfe9..feef1e8 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,11 +1,15 @@ -import { defineConfig } from 'vite'; -import laravel from 'laravel-vite-plugin'; -import tailwindcss from '@tailwindcss/vite'; +import { defineConfig } from "vite"; +import laravel from "laravel-vite-plugin"; +import tailwindcss from "@tailwindcss/vite"; export default defineConfig({ plugins: [ laravel({ - input: ['resources/css/app.css', 'resources/js/app.js'], + input: [ + "resources/css/filament/admin/theme.css", + "resources/css/app.css", + "resources/js/app.js", + ], refresh: true, }), tailwindcss(),