Skip to content

Commit 73c245e

Browse files
committed
Changed export with command
1 parent 64f32cc commit 73c245e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Console/Commands/ExportMessages.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace KgBot\LaravelLocalization\Console\Commands;
44

55
use Illuminate\Console\Command;
6-
use League\Flysystem\Filesystem;
7-
use League\Flysystem\Adapter\Local;
86
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
7+
use League\Flysystem\Adapter\Local;
8+
use League\Flysystem\Filesystem;
99

1010
class ExportMessages extends Command
1111
{
@@ -42,18 +42,18 @@ public function handle()
4242
{
4343
$messages = ExportLocalizations::export()->toArray();
4444

45-
$filepath = config('laravel-localization.js.filepath', resource_path('assets/js'));
46-
$filename = config('laravel-localization.js.filename', 'll_messages.js');
45+
$filepath = config( 'laravel-localization.js.filepath', resource_path( 'assets/js' ) );
46+
$filename = config( 'laravel-localization.js.filename', 'll_messages.js' );
4747

48-
$adapter = new Local($filepath);
49-
$filesystem = new Filesystem($adapter);
48+
$adapter = new Local( $filepath );
49+
$filesystem = new Filesystem( $adapter );
5050

51-
$contents = 'export default messages = '.json_encode($messages);
51+
$contents = 'let messages = ' . json_encode( $messages );
5252

53-
$filesystem->write($filename, $contents);
53+
$filesystem->write( $filename, $contents );
5454

55-
$this->info('Messages exported to JavaScript file, you can find them at '.$filepath.DIRECTORY_SEPARATOR
56-
.$filename);
55+
$this->info( 'Messages exported to JavaScript file, you can find them at ' . $filepath . DIRECTORY_SEPARATOR
56+
. $filename );
5757

5858
return true;
5959
}

0 commit comments

Comments
 (0)