55use Illuminate \Console \Command ;
66use Illuminate \Container \Container ;
77use Illuminate \Filesystem \Filesystem ;
8- use Illuminate \Support \Str ;
98use InfyOm \GeneratorHelpers \LaravelUtils ;
109use Laravel \Ui \Presets \Preset ;
11- use Symfony \Component \Finder \SplFileInfo ;
1210
1311class CoreUIPreset extends Preset
1412{
@@ -29,11 +27,11 @@ public function __construct(Command $command)
2927 protected static function updatePackageArray (array $ packages )
3028 {
3129 return [
32- 'bootstrap ' => '^4.1.0 ' ,
33- 'jquery ' => '^3.2 ' ,
34- 'popper.js ' => '^1.12 ' ,
30+ 'bootstrap ' => '^4.1.0 ' ,
31+ 'jquery ' => '^3.2 ' ,
32+ 'popper.js ' => '^1.12 ' ,
3533 '@coreui/coreui ' => '^3.2.2 ' ,
36- " @coreui/icons " => " ^1.0.1 " ,
34+ ' @coreui/icons ' => ' ^1.0.1 ' ,
3735 ] + $ packages ;
3836 }
3937
@@ -73,7 +71,6 @@ public function installAuth()
7371 $ this ->ensureDirectoriesExist ($ viewsPath );
7472
7573 $ this ->scaffoldAuth ();
76- $ this ->scaffoldController ();
7774 }
7875
7976 protected function ensureDirectoriesExist ($ viewsPath )
@@ -91,23 +88,6 @@ protected function ensureDirectoriesExist($viewsPath)
9188 }
9289 }
9390
94- protected function scaffoldController ()
95- {
96- if (!is_dir ($ directory = app_path ('Http/Controllers/Auth ' ))) {
97- mkdir ($ directory , 0755 , true );
98- }
99-
100- $ filesystem = new Filesystem ;
101-
102- collect ($ filesystem ->allFiles (base_path ('vendor/laravel/ui/stubs/Auth ' )))
103- ->each (function (SplFileInfo $ file ) use ($ filesystem ) {
104- $ filesystem ->copy (
105- $ file ->getPathname (),
106- app_path ('Http/Controllers/Auth/ ' .Str::replaceLast ('.stub ' , '.php ' , $ file ->getFilename ()))
107- );
108- });
109- }
110-
11191 protected function scaffoldAuth ()
11292 {
11393 file_put_contents (app_path ('Http/Controllers/HomeController.php ' ), $ this ->compileHomeControllerStub ());
@@ -118,19 +98,11 @@ protected function scaffoldAuth()
11898 FILE_APPEND
11999 );
120100
121- tap (new Filesystem , function ($ filesystem ) {
101+ tap (new Filesystem () , function ($ filesystem ) {
122102
123103 $ filesystem ->copyDirectory (__DIR__ .'/../coreui-stubs/auth ' , resource_path ('views/auth ' ));
124104 $ filesystem ->copyDirectory (__DIR__ .'/../coreui-stubs/layouts ' , resource_path ('views/layouts ' ));
125105 $ filesystem ->copy (__DIR__ .'/../coreui-stubs/home.blade.php ' , resource_path ('views/home.blade.php ' ));
126-
127- collect ($ filesystem ->allFiles (base_path ('vendor/laravel/ui/stubs/migrations ' )))
128- ->each (function (SplFileInfo $ file ) use ($ filesystem ) {
129- $ filesystem ->copy (
130- $ file ->getPathname (),
131- database_path ('migrations/ ' .$ file ->getFilename ())
132- );
133- });
134106 });
135107 }
136108
@@ -142,4 +114,4 @@ protected function compileHomeControllerStub()
142114 file_get_contents (base_path ('vendor/laravel/ui/src/Auth/stubs/controllers/HomeController.stub ' ))
143115 );
144116 }
145- }
117+ }
0 commit comments