Skip to content

Instantly share code, notes, and snippets.

@yogithesymbian
Created February 10, 2025 05:34
Show Gist options
  • Save yogithesymbian/96a2965fa55ef6de9a30d69a9fcbfe92 to your computer and use it in GitHub Desktop.
Save yogithesymbian/96a2965fa55ef6de9a30d69a9fcbfe92 to your computer and use it in GitHub Desktop.

Revisions

  1. yogithesymbian created this gist Feb 10, 2025.
    11 changes: 11 additions & 0 deletions .zshr
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    laravel_pub() {
    local IP=${1:-$(ipconfig getifaddr en0)} # Use argument if provided, otherwise get local IP

    if [[ -z "$IP" ]]; then
    echo "❌ Failed to determine IP address. Falling back to 127.0.0.1"
    IP="127.0.0.1"
    fi

    echo "🚀 Starting Laravel on http://$IP:8000"
    php artisan serve --host="$IP" --port=8000
    }