Skip to content

Commit

Permalink
Merge pull request #941 from bakaphp/fix-connection-channel
Browse files Browse the repository at this point in the history
fix: connection database many to many channel
  • Loading branch information
FredPeal committed Feb 14, 2024
2 parents caa9792 + e4393a7 commit f0ac220
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Domains/Social/Channels/Models/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Channel extends BaseModel

public function users(): BelongsToMany
{
$databaseSocial = config('database.social.database', 'social');
$databaseSocial = config('database.connections.social.database', 'social');

return $this->belongsToMany(Users::class, $databaseSocial . '.channel_users', 'channel_id', 'users_id')
->withTimestamps()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static function getById(int $id, Users $user): Channel

public static function getByIdBuilder(Users $user): Builder
{
$databaseSocial = config('database.social.database', 'social');
$databaseSocial = config('database.connections.social.database', 'social');
$builder = Channel::join($databaseSocial . '.channel_users', 'channel_users.channel_id', '=', 'channels.id')
->where('users_id', auth()->user()->id);

Expand Down

0 comments on commit f0ac220

Please sign in to comment.