File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public function handle(): int
47
47
$ factoryName = $ entityName . "Factory " ;
48
48
$ interfaceName = "I $ entityName " . "Repository " ;
49
49
$ redisRepositoryName = "Redis $ entityName " . "Repository " ;
50
+ $ redisRepositoryNamespace = config ('repository.path.namespace.repository ' );
50
51
$ relativeRedisRepositoryPath = config ('repository.path.relative.repository ' ) . "\\$ entityName " ;
51
52
52
53
if ($ this ->option ('delete ' )) {
@@ -55,8 +56,9 @@ public function handle(): int
55
56
return 0 ;
56
57
}
57
58
58
- if (!file_exists ($ relativeRedisRepositoryPath )) {
59
- mkdir ($ relativeRedisRepositoryPath );
59
+ if ( ! file_exists ($ relativeRedisRepositoryPath ) && ! mkdir ($ relativeRedisRepositoryPath ) && ! is_dir ($ relativeRedisRepositoryPath )) {
60
+ $ this ->info ("MySql Repository \"$ relativeRedisRepositoryPath \" has been deleted. " );
61
+ return 0 ;
60
62
}
61
63
62
64
if (class_exists ("$ relativeRedisRepositoryPath \\$ redisRepositoryName " ) && !$ this ->option ('force ' )) {
@@ -76,7 +78,7 @@ public function handle(): int
76
78
}
77
79
78
80
// Initialize Redis Repository
79
- $ redisRepositoryContent = "<?php \n\nnamespace $ relativeRedisRepositoryPath ; \n\n" ;
81
+ $ redisRepositoryContent = "<?php \n\nnamespace $ redisRepositoryNamespace \\ $ entityName ; \n\n" ;
80
82
$ redisRepositoryContent .= "use App\Models\Repositories\RedisRepository; \n\n" ;
81
83
$ redisRepositoryContent .= "class $ redisRepositoryName extends RedisRepository \n{ " ;
82
84
$ redisRepositoryContent .= "} " ;
You can’t perform that action at this time.
0 commit comments