Mercurial > packages > auth
annotate src/Console/InstallsBladeStack.php @ 1:a2a3059de103
Updates to some styles and general automation of creation
| author | luka |
|---|---|
| date | Thu, 14 Aug 2025 21:09:25 -0400 |
| parents | 90e38de8f2ba |
| children |
| rev | line source |
|---|---|
| 0 | 1 <?php |
| 2 | |
| 3 namespace Wizard\Auth\Console; | |
| 4 | |
| 5 use Illuminate\Filesystem\Filesystem; | |
| 6 use Symfony\Component\Finder\Finder; | |
| 7 | |
| 8 trait InstallsBladeStack | |
| 9 { | |
| 10 /** | |
| 11 * Install the Blade Breeze stack. | |
| 12 * | |
| 13 * @return int|null | |
| 14 */ | |
| 15 protected function installBladeStack() | |
| 16 { | |
| 17 // NPM Packages... | |
| 18 $this->updateNodePackages(function ($packages) { | |
| 19 return [ | |
| 20 "@popperjs/core" => "^2.11.8", | |
| 21 "bootstrap" => "^5.3.0", | |
| 22 ] + $packages; | |
| 23 }); | |
| 24 | |
| 25 // Controllers... | |
| 26 (new Filesystem)->ensureDirectoryExists(app_path('Http/Controllers')); | |
| 27 (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/default/app/Http/Controllers', app_path('Http/Controllers')); | |
| 28 | |
| 29 // Requests... | |
| 30 (new Filesystem)->ensureDirectoryExists(app_path('Http/Requests')); | |
| 31 (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/default/app/Http/Requests', app_path('Http/Requests')); | |
| 32 | |
| 33 // Views... | |
| 34 (new Filesystem)->ensureDirectoryExists(resource_path('views')); | |
| 35 (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/default/resources/views', resource_path('views')); | |
| 36 | |
| 37 // Components... | |
| 38 (new Filesystem)->ensureDirectoryExists(app_path('View/Components')); | |
| 39 (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/default/app/View/Components', app_path('View/Components')); | |
| 40 | |
| 41 // Tests... | |
| 42 if (! $this->installTests()) { | |
| 43 return 1; | |
| 44 } | |
| 45 | |
| 46 // Routes... | |
| 47 copy(__DIR__.'/../../stubs/default/routes/web.php', base_path('routes/web.php')); | |
| 48 copy(__DIR__.'/../../stubs/default/routes/auth.php', base_path('routes/auth.php')); | |
| 49 | |
| 50 // "Dashboard" Route... | |
| 51 $this->replaceInFile('/home', '/dashboard', resource_path('views/welcome.blade.php')); | |
| 52 $this->replaceInFile('Home', 'Dashboard', resource_path('views/welcome.blade.php')); | |
| 53 | |
|
1
a2a3059de103
Updates to some styles and general automation of creation
luka
parents:
0
diff
changeset
|
54 $this->runCommands(['npm install', 'npm run build']); |
| 0 | 55 |
| 56 $this->line(''); | |
| 57 $this->components->info('Breeze scaffolding installed successfully.'); | |
| 58 } | |
| 59 } |
