You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,19 +101,31 @@ public static function install($command)
78
101
79
102
80
103
publicstaticfunctionpreflight($command){
104
+
try {
105
+
\DB::connection()->getPdo();
106
+
} catch (\Exception$e) {
107
+
echoPHP_EOL;
108
+
$command->error("Your database configuration does not appear to be configured yet. Afterwards, you will need to run 'php artisan react_sync:all' manually to complete installation.");
109
+
echoPHP_EOL;
110
+
111
+
}
112
+
113
+
81
114
$command->info("You are about to install the Laravel ReactSync preset");
82
115
if (!$command->confirm('Would you like to continue?', 'yes')) {
83
116
exit('Cancelled' . PHP_EOL);
84
117
}
85
118
119
+
120
+
86
121
$command->info("The following questions will help get the preset configured for your specific requirements.");
87
122
88
123
if ($command->confirm('Would you like to include the Bootstrap framework?', 'yes')) {
89
-
self::$include_bootstrap = true;
124
+
static::$include_bootstrap = true;
90
125
}
91
126
92
127
if ($command->confirm('Would you like to include an example Page and Model component to get started?', 'yes')) {
93
-
self::$include_example = true;
128
+
static::$include_example = true;
94
129
}
95
130
96
131
@@ -108,7 +143,7 @@ public static function addStartCommand(){
108
143
$package_json['scripts']['start'] = "php artisan react_sync:all && npm run watch";
109
144
}
110
145
else{
111
-
self::$start_added = false;
146
+
static::$start_added = false;
112
147
}
113
148
114
149
file_put_contents(
@@ -176,6 +211,16 @@ protected static function updatePackageArray(array $packages)
176
211
return$packages;
177
212
}
178
213
214
+
protectedstaticfunctionconfirm_copy($from, $to){
215
+
if (file_exists($from)) {
216
+
if (! static::$command->confirm("The file [{$from}] already exists. Do you want to replace it?")) {
217
+
return;
218
+
}
219
+
}
220
+
221
+
copy($from, $to);
222
+
}
223
+
179
224
/**
180
225
* Update the Webpack configuration.
181
226
*
@@ -216,7 +261,7 @@ protected static function updateBootstrapping()
0 commit comments