From ccc3bdfe03c9e62b046b529ac5e6143abc16d162 Mon Sep 17 00:00:00 2001 From: Ryan Scherler Date: Wed, 11 Mar 2020 17:35:50 -0700 Subject: [PATCH] Check for password_resets table in migration --- ...10_100000_create_password_resets_table.php | 21 +++++++++++++------ src/AlpineServiceProvider.php | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/database/migrations/2020_03_10_100000_create_password_resets_table.php b/database/migrations/2020_03_10_100000_create_password_resets_table.php index 0ee0a36a4f..38ef1f3512 100644 --- a/database/migrations/2020_03_10_100000_create_password_resets_table.php +++ b/database/migrations/2020_03_10_100000_create_password_resets_table.php @@ -6,6 +6,13 @@ use Illuminate\Support\Facades\Schema; class CreatePasswordResetsTable extends Migration { + /** + * The name of the table for the migration. + * + * @var string + */ + protected $tableName = 'password_resets'; + /** * Run the migrations. * @@ -13,11 +20,13 @@ class CreatePasswordResetsTable extends Migration */ public function up() { - Schema::create('password_resets', function (Blueprint $table) { - $table->string('email')->index(); - $table->string('token'); - $table->timestamp('created_at')->nullable(); - }); + if (!Schema::hasTable($this->tableName)) { + Schema::create($this->tableName, function (Blueprint $table) { + $table->string('email')->index(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + } } /** @@ -27,6 +36,6 @@ class CreatePasswordResetsTable extends Migration */ public function down() { - Schema::dropIfExists('password_resets'); + Schema::dropIfExists($this->tableName); } } diff --git a/src/AlpineServiceProvider.php b/src/AlpineServiceProvider.php index 3b3044ab7c..b3680815c1 100644 --- a/src/AlpineServiceProvider.php +++ b/src/AlpineServiceProvider.php @@ -22,7 +22,7 @@ class AlpineServiceProvider extends ServiceProvider * * @var string */ - protected $packagePath = __DIR__ . '/../'; + protected $packagePath = __DIR__.'/../'; /** * Register bindings in the container.