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 3535 "mockery/mockery" : " ^1.4.4" ,
3636 "orchestra/testbench" : " ^7.5" ,
3737 "pestphp/pest" : " ^1.21" ,
38- "pestphp/pest-plugin-laravel" : " ^1.2"
38+ "pestphp/pest-plugin-laravel" : " ^1.2" ,
39+ "symfony/var-exporter" : " ^6.0"
3940 },
4041 "autoload" : {
4142 "psr-4" : {
Original file line number Diff line number Diff line change 3232use InfyOm \Generator \Utils \TableFieldsGenerator ;
3333use Symfony \Component \Console \Input \InputArgument ;
3434use Symfony \Component \Console \Input \InputOption ;
35+ use Symfony \Component \VarExporter \VarExporter ;
3536
3637class BaseCommand extends Command
3738{
@@ -246,14 +247,17 @@ private function saveLocaleFile()
246247 $ locales ['fields ' ][$ field ->name ] = Str::title (str_replace ('_ ' , ' ' , $ field ->name ));
247248 }
248249
249- $ path = lang_path ('en/models ' );
250+ $ path = lang_path ('en/models/ ' );
250251
251- $ fileName = $ this ->config ->modelNames ->plural .'.php ' ;
252+ $ fileName = $ this ->config ->modelNames ->snakePlural .'.php ' ;
252253
253254 if (file_exists ($ path .$ fileName ) && !$ this ->confirmOverwrite ($ fileName )) {
254255 return ;
255256 }
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 ;
257261 g_filesystem ()->createFile ($ path .$ fileName , $ content );
258262 $ this ->comment ("\nModel Locale File saved. " );
259263 $ this ->info ($ fileName );
You can’t perform that action at this time.
0 commit comments