Skip to content

Commit

Permalink
Merge pull request #60 from decaluwepatrick/master
Browse files Browse the repository at this point in the history
add binding for ExportLocalizations class in service provider
  • Loading branch information
kg-bot committed May 18, 2020
2 parents 7fdcd2e + 5aac735 commit 80305fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Classes/ExportLocalizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ protected function parseJsonFiles($file, $key, $dir)

public static function exportToArray()
{
return (new self)->export()->toArray();
return \KgBot\LaravelLocalization\Facades\ExportLocalizations::export()->toArray();
}

protected static function executeCallback($strings)
Expand Down
4 changes: 3 additions & 1 deletion src/LaravelLocalizationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ class LaravelLocalizationServiceProvider extends ServiceProvider
{
public function boot()
{
$this->app->bind('export-localization', function () {
$this->app->bind(ExportLocalizations::class, function () {
$phpRegex = config('laravel-localization.file_regexp.php', '/^.+\.php$/i');
$jsonRegex = config('laravel-localization.file_regexp.json', '/^.+\.json$/i');

return new ExportLocalizations($phpRegex, $jsonRegex);
});

$this->app->alias(ExportLocalizations::class, 'export-localization');

/*
* Config
*/
Expand Down

0 comments on commit 80305fd

Please sign in to comment.