Skip to content

Commit 34a6b67

Browse files
committed
fix: use whatever the default connection is for the Star model
1 parent e0f8246 commit 34a6b67

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/Models/Star.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ class Star extends Model
1111
{
1212
use HasFactory;
1313

14-
protected $connection = 'mysql';
15-
1614
public function starrable(): MorphTo
1715
{
1816
return $this->morphTo();
@@ -22,4 +20,9 @@ public function user(): BelongsTo
2220
{
2321
return $this->belongsTo(User::class);
2422
}
23+
24+
public function getConnectionName()
25+
{
26+
return config('database.default');
27+
}
2528
}

0 commit comments

Comments
 (0)