@@ -20,6 +20,7 @@ class LaraBue extends Preset
20
20
*
21
21
* @return void
22
22
*/
23
+
23
24
public static function install ()
24
25
{
25
26
static ::cleanSassDirectory ();
@@ -92,39 +93,57 @@ public static function updatePackageArray(array $packages)
92
93
93
94
public static function updateResources ()
94
95
{
95
- // FOR OLDER VERSIONS
96
-
97
- if (static ::grabAppVersion () <= 5.6 ) {
98
- // SASS stuff copying
96
+ return (static ::grabAppVersion () <= 5.6 ) ? static ::updateOldResources () : static ::updateNewResources ();
97
+ }
98
+
99
+ /**
100
+ * Method for updating resources directory for Laravel less that 5.6 version
101
+ *
102
+ * @return void
103
+ */
104
+
105
+
106
+ public static function updateOldResources ()
107
+ {
108
+ // SASS stuff copying
99
109
100
- copy (__DIR__ . '/stubs/sass/app.scss ' , resource_path ('assets/sass/app.scss ' ));
110
+ copy (__DIR__ . '/stubs/sass/app.scss ' , resource_path ('assets/sass/app.scss ' ));
111
+
112
+ // JS stuff copying
101
113
102
- // JS stuff copying
114
+ copy (__DIR__ . '/stubs/js/app.js ' , resource_path ('assets/js/app.js ' ));
115
+ copy (__DIR__ . '/stubs/js/bootstrap.js ' , resource_path ('assets/js/bootstrap.js ' ));
103
116
104
- copy (__DIR__ . '/stubs/js/app.js ' , resource_path ('assets/js/app.js ' ));
105
- copy (__DIR__ . '/stubs/js/bootstrap.js ' , resource_path ('assets/js/bootstrap.js ' ));
117
+ // everything including components, we just grab components directory from stubs and copy to resources
106
118
107
- // everything including components, we just grab components directory from stubs and copy to resources
119
+ File:: copyDirectory ( __DIR__ . ' /stubs/js/ components' , resource_path ( ' assets/js/ components' ));
108
120
109
- File::copyDirectory (__DIR__ . '/stubs/js/components ' , resource_path ('assets/js/components ' ));
121
+ File::copyDirectory (__DIR__ . '/stubs/js/router ' , resource_path ('assets/js/router ' ));
122
+ }
110
123
111
- File::copyDirectory (__DIR__ . '/stubs/js/router ' , resource_path ('assets/js/router ' ));
112
- } else {
113
- // SASS stuff copying
124
+ /**
125
+ * Method for updating 'resources' directory for Laravel more than 5.6 version
126
+ *
127
+ * @return void
128
+ */
129
+
130
+
131
+ public static function updateNewResources ()
132
+ {
133
+ // SASS stuff copying
114
134
115
- copy (__DIR__ . '/stubs/sass/app.scss ' , resource_path ('sass/app.scss ' ));
135
+ copy (__DIR__ . '/stubs/sass/app.scss ' , resource_path ('sass/app.scss ' ));
116
136
117
- // JS stuff copying
137
+ // JS stuff copying
118
138
119
- copy (__DIR__ . '/stubs/js/app.js ' , resource_path ('js/app.js ' ));
120
- copy (__DIR__ . '/stubs/js/bootstrap.js ' , resource_path ('js/bootstrap.js ' ));
139
+ copy (__DIR__ . '/stubs/js/app.js ' , resource_path ('js/app.js ' ));
140
+ copy (__DIR__ . '/stubs/js/bootstrap.js ' , resource_path ('js/bootstrap.js ' ));
121
141
122
- // everything including components, we just grab components directory from stubs and copy to resources
142
+ // everything including components, we just grab components directory from stubs and copy to resources
123
143
124
- File::copyDirectory (__DIR__ . '/stubs/js/components ' , resource_path ('js/components ' ));
144
+ File::copyDirectory (__DIR__ . '/stubs/js/components ' , resource_path ('js/components ' ));
125
145
126
- File::copyDirectory (__DIR__ . '/stubs/js/router ' , resource_path ('js/router ' ));
127
- }
146
+ File::copyDirectory (__DIR__ . '/stubs/js/router ' , resource_path ('js/router ' ));
128
147
}
129
148
130
149
/**
0 commit comments