Skip to content

Commit

Permalink
Merge pull request #27 from SamuelMwangiW/bugfix/pdo-exception
Browse files Browse the repository at this point in the history
Fix SQLSTATE[HY000] [2002] Connection refused during artisan package:discover
  • Loading branch information
bobbyiliev committed Oct 8, 2021
2 parents 31e25af + 70ac9c2 commit 2497b39
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public function boot()
if ($this->app->environment() == 'production') {
$this->app['request']->server->set('HTTPS', true);
}
// rad man
Schema::defaultStringLength(191);
$this->setSchemaDefaultLength();
}

/**
Expand All @@ -30,4 +29,12 @@ public function register()
{

}

private function setSchemaDefaultLength(): void
{
try {
Schema::defaultStringLength(191);
}
catch (\Exception $exception){}
}
}

0 comments on commit 2497b39

Please sign in to comment.