feat: add functionality to clear Laravel log and display logs in runner script for improved user feedback

This commit is contained in:
2025-12-04 14:07:30 -05:00
parent 17a1df8ec8
commit 69a57459d8
2 changed files with 25 additions and 1 deletions

View File

@@ -666,6 +666,7 @@
</div>
</template>
</div>
@endif
</td>
<td class="py-3 px-4 text-sm">
<div class="flex items-center gap-1">
@@ -763,6 +764,7 @@
</div>
</template>
</div>
@endif
</td>
<td class="py-3 px-4 text-sm">{{ strtoupper($rule['proto'] ?? 'any') }}</td>
<td class="py-3 px-4 text-sm">{{ $rule['dport'] ?? $rule['sport'] ?? '-' }}</td>

View File

@@ -22,7 +22,8 @@ $divider
[3] Run laravallog.sh
[4] Run laravalcache.sh
[5] Clear Laravel log
[6] Exit
[6] Clear Laravel log and show logs
[7] Exit
$divider
Select an option by pressing the number key.
EOF
@@ -58,6 +59,27 @@ EOF
fi
;;
6)
# Clear Laravel log first
LOG_DATE=$(date +%Y-%m-%d)
LOG_FILE="${SCRIPT_DIR}/storage/logs/laravel-${LOG_DATE}.log"
if [ -f "$LOG_FILE" ]; then
> "$LOG_FILE"
echo "Log file cleared successfully: $LOG_FILE"
else
echo "Log file not found: $LOG_FILE"
fi
# Pause and wait for user input
echo
echo "Press Enter to continue and show the logs..."
read -r
# Then show logs
echo "Showing Laravel logs..."
[ -x "$git_log" ] || chmod +x "$git_log"
"$git_log"
;;
7)
echo "Goodbye!"
exit 0
;;