From 40ce6eef62bc5b3458abbd77601b94c165f6b844 Mon Sep 17 00:00:00 2001 From: jalmatari Date: Sat, 15 Feb 2020 17:58:10 +0300 Subject: [PATCH] Update MaxMindDatabase.php --- src/Services/MaxMindDatabase.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Services/MaxMindDatabase.php b/src/Services/MaxMindDatabase.php index a6b096d..69b5429 100644 --- a/src/Services/MaxMindDatabase.php +++ b/src/Services/MaxMindDatabase.php @@ -22,15 +22,14 @@ class MaxMindDatabase extends AbstractService */ public function boot() { + $path = $this->config('database_path'); // Copy test database for now - if (file_exists($this->config('database_path')) === false) { - copy(__DIR__ . '/../../resources/geoip.mmdb', $this->config('database_path')); + if (file_exists($path) === false) { + mkdir(str_replace('/geoip.mmdb', '', $path)); + copy(__DIR__ . '/../../resources/geoip.mmdb', $path); } - $this->reader = new Reader( - $this->config('database_path'), - $this->config('locales', ['en']) - ); + $this->reader = new Reader( $path, $this->config('locales', ['en'])); } /**