Skip to content

Commit

Permalink
configurable Translation model
Browse files Browse the repository at this point in the history
  • Loading branch information
ecasas91 committed Mar 21, 2024
1 parent 5dae65b commit 29e79da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/Repositories/TranslationBaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ abstract class TranslationBaseRepository extends BaseRepository
{
public function model() : String
{
return Translation::class;
return config('mage.translations.model', Translation::class);
}
}
3 changes: 2 additions & 1 deletion src/config/mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
],
'import_path' => [
resource_path('lang')
]
],
'model' => Omatech\Mage\App\Models\Translation::class
],

/**
Expand Down
2 changes: 1 addition & 1 deletion src/config/translation-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* This is the model used by the Db Translation loader. You can put any model here
* that extends Spatie\TranslationLoader\LanguageLine.
*/
'model' => Omatech\Mage\App\Models\Translation::class,
'model' => config('mage.translations.model', Omatech\Mage\App\Models\Translation::class),

/*
* This is the translation manager which overrides the default Laravel `translation.loader`
Expand Down

1 comment on commit 29e79da

@falconfx
Copy link
Contributor

@falconfx falconfx commented on 29e79da Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release Co-authorized: Christian Bohollo and Javier Mogollón

Please sign in to comment.