From 401c122167fb6c2b5778abf3704f3018c79ddfd1 Mon Sep 17 00:00:00 2001 From: farida Date: Tue, 14 Apr 2026 14:48:35 +0700 Subject: [PATCH 1/3] feat: remove unused `$withCount` property from the `Tag` model. --- src/Models/Tag.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Models/Tag.php b/src/Models/Tag.php index 92aa5669..2c815723 100644 --- a/src/Models/Tag.php +++ b/src/Models/Tag.php @@ -42,11 +42,6 @@ protected static function newFactory() 'name', ]; - /** @var array */ - protected $withCount = [ - 'subscribers' - ]; - public function campaigns(): BelongsToMany { return $this->belongsToMany(Campaign::class, 'sendportal_campaign_tag'); From 89ea82cc6efd85c93969e5c4688951106b602862 Mon Sep 17 00:00:00 2001 From: farida Date: Tue, 14 Apr 2026 15:51:47 +0700 Subject: [PATCH 2/3] refactor: remove redundant index from `sendportal_tag_subscriber` migration --- .../2026_04_14_000002_drop_id_from_tag_subscriber.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/database/migrations/2026_04_14_000002_drop_id_from_tag_subscriber.php b/database/migrations/2026_04_14_000002_drop_id_from_tag_subscriber.php index 18b6644b..3c0fd1ae 100644 --- a/database/migrations/2026_04_14_000002_drop_id_from_tag_subscriber.php +++ b/database/migrations/2026_04_14_000002_drop_id_from_tag_subscriber.php @@ -10,7 +10,6 @@ public function up(): void { Schema::table('sendportal_tag_subscriber', function (Blueprint $table) { $table->dropColumn('id'); - $table->dropIndex('idx_tag_subscriber'); // redundant after PK change $table->primary(['tag_id', 'subscriber_id']); }); } @@ -20,7 +19,6 @@ public function down(): void Schema::table('sendportal_tag_subscriber', function (Blueprint $table) { $table->dropPrimary(['tag_id', 'subscriber_id']); $table->increments('id')->first(); - $table->index(['tag_id', 'subscriber_id'], 'idx_tag_subscriber'); }); } } From 37589f6216af2891a51bde158f507c2908ea9505 Mon Sep 17 00:00:00 2001 From: farida Date: Tue, 14 Apr 2026 16:47:48 +0700 Subject: [PATCH 3/3] Revert "feat: remove unused `$withCount` property from the `Tag` model." This reverts commit 401c122167fb6c2b5778abf3704f3018c79ddfd1. --- src/Models/Tag.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Models/Tag.php b/src/Models/Tag.php index 2c815723..92aa5669 100644 --- a/src/Models/Tag.php +++ b/src/Models/Tag.php @@ -42,6 +42,11 @@ protected static function newFactory() 'name', ]; + /** @var array */ + protected $withCount = [ + 'subscribers' + ]; + public function campaigns(): BelongsToMany { return $this->belongsToMany(Campaign::class, 'sendportal_campaign_tag');