Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/translation-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@
],

/**
* Database connection name to allow for different db connection for the translations table.
* Database table and connection name to allow for different db connection for the translations table.
*/
'db_table' => env('TRANSLATION_MANAGER_DB_TABLE', null),
'db_connection' => env('TRANSLATION_MANAGER_DB_CONNECTION', null),

];
14 changes: 14 additions & 0 deletions src/Models/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ public function scopeSelectDistinctGroup($query)
return $query->select(DB::raw($select));
}

/**
* Get the table associated with the model.
*
* @return string
*/
public function getTable()
{
if ($table = config('translation-manager.db_table')){
return $table;
}

return parent::getTable();
}

/**
* Get the current connection name for the model.
*
Expand Down