diff --git a/.env.example b/.env.example
index cd880fa..d3f13b3 100644
--- a/.env.example
+++ b/.env.example
@@ -9,8 +9,6 @@ APP_URL=http://localhost
LOG_CHANNEL=stack
-CACHE_BUST=
-
BS_HOST=localhost
DB_CONNECTION=mysql
diff --git a/app/Utilities/Version.php b/app/Utilities/Version.php
new file mode 100644
index 0000000..74c7665
--- /dev/null
+++ b/app/Utilities/Version.php
@@ -0,0 +1,30 @@
+ Intervention\Image\Facades\Image::class,
'Language' => App\Utilities\Language::class,
+ 'Version' => App\Utilities\Version::class,
]
diff --git a/gulpfile.js b/gulpfile.js
index 77d4b5b..22856c3 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -4,7 +4,9 @@ const gulp = require("gulp"),
log = require("fancy-log"),
insert = require("gulp-insert"),
plumber = require("gulp-plumber"),
- concat = require("gulp-concat");
+ concat = require("gulp-concat"),
+ fs = require("fs"),
+ crypto = require("crypto");
// Sass and CSS packages
const sass = require("gulp-sass"),
@@ -176,6 +178,17 @@ function processJavaScript(outputFilename, inputFiles, es6) {
return javascript.pipe(gulp.dest("public/js/"));
}
+// Update the version string
+function updateVersion() {
+ crypto.randomBytes(16, (err, buf) => {
+ if (err) { throw err; }
+
+ return fs.writeFile("storage/app/__version.txt", buf.toString("hex"), (err) => {
+ if (err) { throw err; }
+ });
+ });
+}
+
// Task for error page styles
gulp.task("sass-error", () => {
return processSass("error");
@@ -225,9 +238,16 @@ gulp.task("fonts", (done) => {
done();
});
+// Task to update the cache-bust version
+gulp.task("version", (done) => {
+ updateVersion();
+ done();
+});
+
// Task to watch files and run respective tasks when changes occur
gulp.task("watch", () => {
const browserSyncReload = (done) => {
+ updateVersion();
browserSync.reload();
done();
};
@@ -260,5 +280,6 @@ gulp.task("default", gulp.parallel(
"js-public-libs",
"js-dashboard",
"js-dashboard-libs",
- "fonts"
+ "fonts",
+ "version"
));
diff --git a/init.sh b/init.sh
index 9c820ce..29600fd 100755
--- a/init.sh
+++ b/init.sh
@@ -81,14 +81,6 @@ php artisan route:clear
msg "Running: ${c_m}php artisan view:clear"
php artisan view:clear
-grep -qe '^CACHE_BUST=' .env || {
- msg "Adding the ${c_y}CACHE_BUST$c_w variable"
- printf '\n%s\n' 'CACHE_BUST=' >> .env
-}
-
-msg "Updating ${c_y}CACHE_BUST$c_w variable"
-sed -i 's|^CACHE_BUST=.*|CACHE_BUST='"$(LC_CTYPE=C LANG=C tr -dc A-Za-z0-9
-
-
-
+
+
+
@yield('page-includes')
@@ -50,7 +50,7 @@
@if(Config::get('app.debug') && Config::get('app.env') === 'local')
@endif