@@ -15,7 +15,8 @@ class CreateContractAndResponse extends Command
1515 * @var string
1616 */
1717 protected $ signature = 'make:contract-response {name : The name of the contract and response (e.g., Auth)}
18- {--provider=HomeController1Provider : The name of the service provider to bind the contract and response} ' ;
18+ {--provider=HomeController1Provider : The name of the service provider to bind the contract and response}
19+ {--test : In order to test the command} ' ;
1920 /**
2021 * The console command description.
2122 *
@@ -60,7 +61,9 @@ public function handle()
6061 $ this ->createResponse ($ responseName , $ contractName );
6162
6263 // Bind Contract and Response in the service provider
63- $ this ->bindContractAndResponse ($ contractName , $ responseName );
64+ if (!$ this ->option ('test ' )){
65+ $ this ->bindContractAndResponse ($ contractName , $ responseName );
66+ }
6467
6568 $ this ->info ("Contract, Response, and binding created successfully! " );
6669 }
@@ -119,8 +122,7 @@ protected function createResponse($responseName, $contractName)
119122 protected function bindContractAndResponse ($ contractName , $ responseName )
120123 {
121124 $ providerName = $ this ->option ('provider ' );
122- $ providerPath = base_path ("app/Providers/ {$ providerName }.php " );
123-
125+ $ providerPath = app_path ("Providers/ {$ providerName }.php " );
124126
125127 if (!$ this ->files ->exists ($ providerPath )) {
126128 $ this ->info ("Service provider {$ providerName } not found. Creating one.... " );
0 commit comments