66use Eghamat24 \DatabaseRepository \Creators \BaseCreator ;
77use Eghamat24 \DatabaseRepository \Creators \CreatorEnum ;
88use Eghamat24 \DatabaseRepository \CustomMySqlQueries ;
9- use Illuminate \Console \Command ;
109
1110class MakeEnum extends BaseCommand
1211{
12+ use CustomMySqlQueries;
13+
1314 /**
1415 * The name and signature of the console command.
1516 *
@@ -27,8 +28,6 @@ class MakeEnum extends BaseCommand
2728 */
2829 protected $ description = 'Create a new enum(s). ' ;
2930
30- use CustomMySqlQueries;
31-
3231 public function handle (): void
3332 {
3433 $ this ->setArguments ();
@@ -39,10 +38,10 @@ public function handle(): void
3938 $ enums = [];
4039 foreach ($ columns as $ _column ) {
4140 if ($ _column ->DATA_TYPE == 'enum ' ) {
42- $ enumClassName = Str::studly (Str::singular (ucfirst (Str::camel ($ _column ->TABLE_NAME ))) . '_ ' . $ _column ->COLUMN_NAME ) . " Enum " ;
41+ $ enumClassName = Str::studly (Str::singular (ucfirst (Str::camel ($ _column ->TABLE_NAME ))) . '_ ' . $ _column ->COLUMN_NAME ) . ' Enum ' ;
4342 $ enums [$ enumClassName ] = array_filter (explode (', ' , str_replace (['enum( ' , '\'' , ') ' ], ['' , '' , '' ], $ _column ->COLUMN_TYPE )));
4443 $ filenameWithPath = $ this ->relativeEnumsPath . $ enumClassName . '.php ' ;
45- $ this ->checkDelete ($ filenameWithPath , $ enumClassName , " Enum " );
44+ $ this ->checkDelete ($ filenameWithPath , $ enumClassName , ' Enum ' );
4645 }
4746 }
4847
@@ -52,7 +51,7 @@ public function handle(): void
5251 $ filenameWithPath = $ this ->relativeEnumsPath . $ enumName . '.php ' ;
5352
5453 $ this ->checkDirectory ($ this ->enumNamespace );
55- $ this ->checkClassExist ($ this ->relativeEnumsPath , $ enumName , " Enum " );
54+ $ this ->checkClassExist ($ this ->relativeEnumsPath , $ enumName , ' Enum ' );
5655
5756 $ enumCreator = new CreatorEnum ($ columns , $ attributeStub , $ enum , $ enumName , $ this ->enumNamespace );
5857 $ creator = new BaseCreator ($ enumCreator );
0 commit comments