File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,25 @@ public function boot()
1818 require __DIR__ .'/../routes/web.php ' ;
1919 });
2020
21- if ($ this ->app ->runningInConsole ()) {
21+ if ($ this ->app ->runningInConsole ()) {
2222 $ this ->publishes ([
2323 __DIR__ .'/../config/config.php ' => config_path ('keysmith.php ' ),
2424 ], 'keysmith-config ' );
2525
26- (new Filesystem )->ensureDirectoryExists (app_path ('Http/Controllers/APITokens ' ));
27- (new Filesystem )->copy (__DIR__ .'/../stubs/app/Http/Controllers/APITokens/TokenController.php ' , app_path ('Http/Controllers/APITokens/TokenController.php ' ));
26+ $ fs = new Filesystem ();
27+ $ source = __DIR__ .'/../stubs/app/Http/Controllers/APITokens/TokenController.php ' ;
28+ $ target = app_path ('Http/Controllers/APITokens/TokenController.php ' );
29+
30+ // Publish mapping so users can explicitly re-publish if needed
31+ $ this ->publishes ([
32+ $ source => $ target ,
33+ ], 'keysmith-controllers ' );
34+
35+ // One-time seed for fresh installs only (do NOT overwrite user code)
36+ if (! $ fs ->exists ($ target )) {
37+ $ fs ->ensureDirectoryExists (dirname ($ target ));
38+ $ fs ->copy ($ source , $ target );
39+ }
2840 }
2941
3042 $ this ->commands ([
You can’t perform that action at this time.
0 commit comments