diff --git a/src/TranslationServiceProvider.php b/src/TranslationServiceProvider.php index 5684574..36dca0a 100644 --- a/src/TranslationServiceProvider.php +++ b/src/TranslationServiceProvider.php @@ -10,6 +10,8 @@ use JoeDixon\Translation\Console\Commands\ListMissingTranslationKeys; use JoeDixon\Translation\Console\Commands\SynchroniseMissingTranslationKeys; use JoeDixon\Translation\Console\Commands\SynchroniseTranslationsCommand; +use JoeDixon\Translation\Drivers\Database; +use JoeDixon\Translation\Drivers\File; use JoeDixon\Translation\Drivers\Translation; class TranslationServiceProvider extends ServiceProvider @@ -181,5 +183,16 @@ private function registerContainerBindings() $this->app->singleton(Translation::class, function ($app) { return (new TranslationManager($app, $app['config']['translation'], $app->make(Scanner::class)))->resolve(); }); + + $this->app->singleton(File::class, function ($app) { + $scanner = $app->make(Scanner::class); + $languageFilesPath = $app->config['app']['locale']; + + return new File(new Filesystem(), $app['path.lang'], $languageFilesPath, $scanner); + }); + + $this->app->singleton(Database::class, function ($app) { + return new Database($app->config['app']['locale'], $app->make(Scanner::class)); + }); } }