10
10
use Laravel \Ui \Presets \Preset ;
11
11
use Symfony \Component \Finder \SplFileInfo ;
12
12
13
-
14
13
class StislaPreset extends Preset
15
14
{
16
15
/** @var Command */
@@ -27,30 +26,30 @@ public function __construct(Command $command, $isFortify = false)
27
26
/**
28
27
* Update the given package array.
29
28
*
30
- * @param array $packages
29
+ * @param array $packages
31
30
*
32
31
* @return array
33
32
*/
34
33
protected static function updatePackageArray (array $ packages , $ configurationKey )
35
34
{
36
35
$ stislaPackages = [
37
36
'dependencies ' => [
38
- " bootstrap " => " ^4.0.0 " ,
39
- " jquery " => " ^3.2 " ,
40
- " popper.js " => " ^1.12 " ,
41
- " @fortawesome/fontawesome-free " => " ^5.13.1 " ,
42
- " jquery.nicescroll " => " ^3.7.6 " ,
43
- " vue-template-compiler " => " ^2.6.12 " ,
44
- " vue " => " ^2.5.17 " ,
45
- " datatables.net-dt " => " ^1.10.21 " ,
46
- " jsrender " => " ^1.0.5 " ,
47
- " sweetalert " => " ^1.1.3 " ,
48
- " select2 " => " ^4.0.13 " ,
49
- " izitoast " => " ^1.4.0 " ,
37
+ ' bootstrap ' => ' ^4.0.0 ' ,
38
+ ' jquery ' => ' ^3.2 ' ,
39
+ ' popper.js ' => ' ^1.12 ' ,
40
+ ' @fortawesome/fontawesome-free ' => ' ^5.13.1 ' ,
41
+ ' jquery.nicescroll ' => ' ^3.7.6 ' ,
42
+ ' vue-template-compiler ' => ' ^2.6.12 ' ,
43
+ ' vue ' => ' ^2.5.17 ' ,
44
+ ' datatables.net-dt ' => ' ^1.10.21 ' ,
45
+ ' jsrender ' => ' ^1.0.5 ' ,
46
+ ' sweetalert ' => ' ^1.1.3 ' ,
47
+ ' select2 ' => ' ^4.0.13 ' ,
48
+ ' izitoast ' => ' ^1.4.0 ' ,
50
49
],
51
50
'devDependencies ' => [
52
- " webpack " => " ^5.23.0 " ,
53
- ]
51
+ ' webpack ' => ' ^5.23.0 ' ,
52
+ ],
54
53
];
55
54
56
55
return $ stislaPackages [$ configurationKey ] + $ packages ;
@@ -75,7 +74,6 @@ protected static function updateWebpackConfiguration()
75
74
copy (__DIR__ .'/../stisla-stubs/vendors/bootstrap/webpack.mix.js ' , base_path ('webpack.mix.js ' ));
76
75
}
77
76
78
-
79
77
public function installAuth ()
80
78
{
81
79
$ viewsPath = LaravelUtils::getViewPath ();
@@ -84,26 +82,26 @@ public function installAuth()
84
82
85
83
$ this ->scaffoldAuth ();
86
84
87
- if (! $ this ->isFortify ) {
85
+ if (!$ this ->isFortify ) {
88
86
$ this ->scaffoldController ();
89
87
}
90
88
}
91
89
92
90
protected function ensureDirectoriesExist ($ viewsPath )
93
91
{
94
- if (! file_exists ($ viewsPath .'layouts ' )) {
92
+ if (!file_exists ($ viewsPath .'layouts ' )) {
95
93
mkdir ($ viewsPath .'layouts ' , 0755 , true );
96
94
}
97
95
98
- if (! file_exists ($ viewsPath .'profile ' )) {
96
+ if (!file_exists ($ viewsPath .'profile ' )) {
99
97
mkdir ($ viewsPath .'profile ' , 0755 , true );
100
98
}
101
99
102
- if (! file_exists ($ viewsPath .'auth ' )) {
100
+ if (!file_exists ($ viewsPath .'auth ' )) {
103
101
mkdir ($ viewsPath .'auth ' , 0755 , true );
104
102
}
105
103
106
- if (! file_exists ($ viewsPath .'auth/passwords ' )) {
104
+ if (!file_exists ($ viewsPath .'auth/passwords ' )) {
107
105
mkdir ($ viewsPath .'auth/passwords ' , 0755 , true );
108
106
}
109
107
}
@@ -128,7 +126,7 @@ private function addHomeRoute()
128
126
129
127
protected function scaffoldController ()
130
128
{
131
- if (! is_dir ($ directory = app_path ('Http/Controllers/Auth ' ))) {
129
+ if (!is_dir ($ directory = app_path ('Http/Controllers/Auth ' ))) {
132
130
mkdir ($ directory , 0755 , true );
133
131
}
134
132
@@ -149,7 +147,7 @@ protected function scaffoldAuth()
149
147
150
148
$ this ->addHomeRoute ();
151
149
152
- if (! $ this ->isFortify ) {
150
+ if (!$ this ->isFortify ) {
153
151
$ this ->addAuthRoutes ();
154
152
}
155
153
@@ -159,7 +157,6 @@ protected function scaffoldAuth()
159
157
$ filesystem ->copyDirectory (__DIR__ .'/../stisla-stubs/views/profile ' , resource_path ('views/profile ' ));
160
158
$ filesystem ->copy (__DIR__ .'/../stisla-stubs/home.blade.php ' , resource_path ('views/home.blade.php ' ));
161
159
162
-
163
160
collect ($ filesystem ->allFiles (base_path ('vendor/laravel/ui/stubs/migrations ' )))
164
161
->each (function (SplFileInfo $ file ) use ($ filesystem ) {
165
162
$ filesystem ->copy (
0 commit comments