Skip to content

Commit

Permalink
Merge branch '47-bug-attempt-to-read-property-value-on-null-error' of…
Browse files Browse the repository at this point in the history
… github.com:vormkracht10/filament-two-factor-auth into 47-bug-attempt-to-read-property-value-on-null-error
  • Loading branch information
Baspa committed Oct 4, 2024
2 parents 583a75b + 33bf018 commit e66c590
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/TwoFactorAuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,14 @@ public function configurePackage(Package $package): void
if ($command->confirm('Would you like to publish the config file?', true)) {
$command->comment('Publishing config...');
$command->callSilently('vendor:publish', [
'--tag' =>
"{$package->shortName()}-config",
'--tag' => "{$package->shortName()}-config",
]);
}

if ($command->confirm('Would you like to publish the migrations?', true)) {
$command->comment('Publishing migrations...');
$command->callSilently('vendor:publish', [
'--tag' =>
"{$package->shortName()}-migrations",
'--tag' => "{$package->shortName()}-migrations",
]);
}

Expand All @@ -74,13 +72,13 @@ public function configurePackage(Package $package): void

if ($command->confirm('Would you like us to set the two factor type to "authenticator" for existing users?', true)) {

if (!Schema::hasTable('users')) {
if (! Schema::hasTable('users')) {
$command->error('Table users does not exist.');

return;
}

if (!Schema::hasColumn('users', 'two_factor_type')) {
if (! Schema::hasColumn('users', 'two_factor_type')) {
$command->error('Column two_factor_type does not exist in table users. Please run the migrations first.');

return;
Expand Down

0 comments on commit e66c590

Please sign in to comment.