From 0edfa512c7bd71a7f4153451046de375f4e66922 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 18 Dec 2021 10:30:06 +1100 Subject: [PATCH] Fix for creating users - active wasnt included. Also make admin default to FALSE --- src/Base.php | 1 + src/Listeners/AppHomeOpenedListener.php | 2 +- src/database/migrations/2021_08_06_002815_slack_integration.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Base.php b/src/Base.php index 16e6347..baee426 100644 --- a/src/Base.php +++ b/src/Base.php @@ -102,6 +102,7 @@ abstract class Base if (! $o->exists) { $o->team_id = $this->enterprise_id ? NULL : $this->team()->id; $o->enterprise_id = ($x=$this->enterprise())->exists ? $x->id : NULL; + $o->active = TRUE; $o->save(); Log::debug(sprintf('%s: User Created in DB [%s] (%s)',self::LOGKEY,$this->user_id,$o->id)); diff --git a/src/Listeners/AppHomeOpenedListener.php b/src/Listeners/AppHomeOpenedListener.php index 85a9318..0281300 100644 --- a/src/Listeners/AppHomeOpenedListener.php +++ b/src/Listeners/AppHomeOpenedListener.php @@ -4,9 +4,9 @@ namespace Slack\Listeners; use Illuminate\Support\Facades\Log; use Illuminate\Contracts\Queue\ShouldQueue; +use Slack\Event\AppHomeOpened; use App\Jobs\SlackHomeTabUpdate; -use Slack\Event\AppHomeOpened; class AppHomeOpenedListener implements ShouldQueue { diff --git a/src/database/migrations/2021_08_06_002815_slack_integration.php b/src/database/migrations/2021_08_06_002815_slack_integration.php index ffa6110..e27a561 100644 --- a/src/database/migrations/2021_08_06_002815_slack_integration.php +++ b/src/database/migrations/2021_08_06_002815_slack_integration.php @@ -29,7 +29,7 @@ class SlackIntegration extends Migration $table->string('user_id', 45)->unique(); $table->string('name')->nullable(); $table->boolean('active'); - $table->boolean('admin'); + $table->boolean('admin')->default(FALSE); $table->integer('enterprise_id')->nullable()->unsigned(); $table->foreign('enterprise_id')->references('id')->on('slack_enterprises');