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
4747 $ factoryName = $ entityName . "Factory " ;
4848 $ interfaceName = "I $ entityName " . "Repository " ;
4949 $ redisRepositoryName = "Redis $ entityName " . "Repository " ;
50+ $ redisRepositoryNamespace = config ('repository.path.namespace.repository ' );
5051 $ relativeRedisRepositoryPath = config ('repository.path.relative.repository ' ) . "\\$ entityName " ;
5152
5253 if ($ this ->option ('delete ' )) {
@@ -55,8 +56,9 @@ public function handle(): int
5556 return 0 ;
5657 }
5758
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 ;
6062 }
6163
6264 if (class_exists ("$ relativeRedisRepositoryPath \\$ redisRepositoryName " ) && !$ this ->option ('force ' )) {
@@ -76,7 +78,7 @@ public function handle(): int
7678 }
7779
7880 // Initialize Redis Repository
79- $ redisRepositoryContent = "<?php \n\nnamespace $ relativeRedisRepositoryPath ; \n\n" ;
81+ $ redisRepositoryContent = "<?php \n\nnamespace $ redisRepositoryNamespace \\ $ entityName ; \n\n" ;
8082 $ redisRepositoryContent .= "use App\Models\Repositories\RedisRepository; \n\n" ;
8183 $ redisRepositoryContent .= "class $ redisRepositoryName extends RedisRepository \n{ " ;
8284 $ redisRepositoryContent .= "} " ;
You can’t perform that action at this time.
0 commit comments