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 @@ -45,6 +45,7 @@ public function handle(): int
45
45
$ entityName = str_singular (ucfirst (camel_case ($ tableName )));
46
46
$ entityVariableName = camel_case ($ entityName );
47
47
$ interfaceName = "I $ entityName " . "Repository " ;
48
+ $ interfaceNamespace = config ('repository.path.namespace.repository ' );
48
49
$ relativeInterfacePath = config ('repository.path.relative.repository ' ) . "\\$ entityName " ;
49
50
50
51
if ($ this ->option ('delete ' )) {
@@ -53,8 +54,9 @@ public function handle(): int
53
54
return 0 ;
54
55
}
55
56
56
- if (!file_exists ($ relativeInterfacePath )) {
57
- mkdir ($ relativeInterfacePath , 775 , true );
57
+ if ( ! file_exists ($ relativeInterfacePath ) && ! mkdir ($ relativeInterfacePath , 775 , true ) && ! is_dir ($ relativeInterfacePath )) {
58
+ $ this ->alert ("Directory \"$ relativeInterfacePath \" was not created " );
59
+ return 0 ;
58
60
}
59
61
60
62
if (class_exists ("$ relativeInterfacePath \\$ interfaceName " ) && !$ this ->option ('force ' )) {
@@ -74,7 +76,7 @@ public function handle(): int
74
76
}
75
77
76
78
// Initialize Interface
77
- $ interfaceContent = "<?php \n\nnamespace $ relativeInterfacePath ; \n\n" ;
79
+ $ interfaceContent = "<?php \n\nnamespace $ interfaceNamespace \\ $ entityName ; \n\n" ;
78
80
$ interfaceContent .= "use App\Models\Entities \\$ entityName; \n" ;
79
81
$ interfaceContent .= "use Illuminate\Support\Collection; \n\n" ;
80
82
$ interfaceContent .= "interface $ interfaceName \n{ " ;
You can’t perform that action at this time.
0 commit comments