diff --git a/src/common/etc/entrypoint.d/50-laravel-automations.sh b/src/common/etc/entrypoint.d/50-laravel-automations.sh index b6f217de7..f7dfa6e60 100644 --- a/src/common/etc/entrypoint.d/50-laravel-automations.sh +++ b/src/common/etc/entrypoint.d/50-laravel-automations.sh @@ -41,6 +41,21 @@ if [ "$DISABLE_DEFAULT_CONFIG" = "false" ]; then # Check to see if an Artisan file exists and assume it means Laravel is configured. if [ -f "$APP_BASE_DIR/artisan" ] && [ "$AUTORUN_ENABLED" = "true" ]; then echo "Checking for Laravel automations..." + + ############################################################################ + # recreate storage + ############################################################################ + if [ "${AUTORUN_LARAVEL_STORAGE_RECREATE:=true}" = "true" ]; then + + storage_paths='storage/app/public storage/framework/cache/data storage/framework/sessions storage/framework/testings storage/framework/views storage/logs' + + for path in ${storage_paths}; do + if [ ! -d "$path" ]; then + mkdir -p "$path" + echo "✅ Recreated [$path] directory." + fi + done + ############################################################################ # artisan migrate ############################################################################