File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 35
35
"mockery/mockery" : " ^1.4.4" ,
36
36
"orchestra/testbench" : " ^7.5" ,
37
37
"pestphp/pest" : " ^1.21" ,
38
- "pestphp/pest-plugin-laravel" : " ^1.2"
38
+ "pestphp/pest-plugin-laravel" : " ^1.2" ,
39
+ "symfony/var-exporter" : " ^6.0"
39
40
},
40
41
"autoload" : {
41
42
"psr-4" : {
Original file line number Diff line number Diff line change 32
32
use InfyOm \Generator \Utils \TableFieldsGenerator ;
33
33
use Symfony \Component \Console \Input \InputArgument ;
34
34
use Symfony \Component \Console \Input \InputOption ;
35
+ use Symfony \Component \VarExporter \VarExporter ;
35
36
36
37
class BaseCommand extends Command
37
38
{
@@ -246,14 +247,17 @@ private function saveLocaleFile()
246
247
$ locales ['fields ' ][$ field ->name ] = Str::title (str_replace ('_ ' , ' ' , $ field ->name ));
247
248
}
248
249
249
- $ path = lang_path ('en/models ' );
250
+ $ path = lang_path ('en/models/ ' );
250
251
251
- $ fileName = $ this ->config ->modelNames ->plural .'.php ' ;
252
+ $ fileName = $ this ->config ->modelNames ->snakePlural .'.php ' ;
252
253
253
254
if (file_exists ($ path .$ fileName ) && !$ this ->confirmOverwrite ($ fileName )) {
254
255
return ;
255
256
}
256
- $ content = "<?php \n\nreturn " .var_export ($ locales , true ).'; ' .infy_nl ();
257
+
258
+ $ locales = VarExporter::export ($ locales );
259
+ $ end = '; ' .infy_nl ();
260
+ $ content = "<?php \n\nreturn " .$ locales .$ end ;
257
261
g_filesystem ()->createFile ($ path .$ fileName , $ content );
258
262
$ this ->comment ("\nModel Locale File saved. " );
259
263
$ this ->info ($ fileName );
You can’t perform that action at this time.
0 commit comments