We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21d0b28 commit 9151004Copy full SHA for 9151004
src/Console/Commands/MakeApiCommand.php
@@ -42,6 +42,15 @@ class MakeApiCommand extends Command
42
*/
43
protected $description = "Create a new JSON API configuration file";
44
45
+ public function configPath($filename)
46
+ {
47
+ if (function_exists('config_path')) {
48
+ return config_path($filename);
49
+ }
50
+
51
+ return app()->basePath() . '/config/' . $filename;
52
53
54
/**
55
* @param Filesystem $files
56
* @return int
@@ -55,7 +64,7 @@ public function handle(Filesystem $files)
64
65
$filename = sprintf('json-api-%s.php', Str::dasherize($name));
57
66
58
- if ($files->exists($path = config_path($filename))) {
67
+ if ($files->exists($path = $this->configPath($filename))) {
59
68
$this->error("JSON API '$name' already exists.");
60
69
return 1;
61
70
}
0 commit comments