Skip to content

Commit 5f600f9

Browse files
committed
Rename stub files
1 parent 8774f0a commit 5f600f9

7 files changed

+11
-4
lines changed

src/ControllersCommand.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use Illuminate\Console\Command;
66
use Illuminate\Filesystem\Filesystem;
7+
use Illuminate\Support\Str;
8+
use Symfony\Component\Finder\SplFileInfo;
79

810
class ControllersCommand extends Command
911
{
@@ -32,10 +34,15 @@ public function handle()
3234
mkdir($directory, 0755, true);
3335
}
3436

35-
(new Filesystem)->copyDirectory(
36-
__DIR__.'/../stubs/Auth',
37-
app_path('Http/Controllers/Auth')
38-
);
37+
$filesystem = new Filesystem;
38+
39+
collect($filesystem->allFiles( __DIR__.'/../stubs/Auth'))
40+
->each(function (SplFileInfo $file) use ($filesystem) {
41+
$filesystem->copy(
42+
$file->getPathname(),
43+
app_path('Http/Controllers/Auth/'.Str::replaceLast('.stub', '.php', $file->getFilename()))
44+
);
45+
});
3946

4047
$this->info('Authentication scaffolding generated successfully.');
4148
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)