• Laravel
  • Laravel Spark Installation issues in LIVE PRODUCTION

Laravel Spark Installation issues in LIVE PRODUCTION

Fixing the Hardcoded stripe listen URL for Production in Laravel Spark

Since the stripe listen --forward-to http://127.0.0.1:8000/spark/webhook is hardcoded in the vendor files, it means that Laravel Spark or another package is setting it automatically. To fix this for a live production server, follow these steps:


1. Manually Update the Hardcoded Webhook URL

Since it’s in the vendor directory, you will need to modify it manually.

Step 1: Locate the Files

Run:

grep -R "stripe listen" vendor/

From your previous command output, it's found in:

  • vendor/composer/installed.json
  • vendor/laravel/spark-stripe/composer.json
  • composer.lock

Step 2: Manually Edit the Files

Edit each file using nano:

1️⃣ Edit vendor/laravel/spark-stripe/composer.json

nano vendor/laravel/spark-stripe/composer.json

Find:

"stripe listen --forward-to http://127.0.0.1:8000/spark/webhook"

Change it to:

"stripe listen --forward-to https://www.wizbrand.com/subscription/spark/webhook"

Save the file (CTRL + X, then Y, then Enter).


2️⃣ Edit vendor/composer/installed.json

nano vendor/composer/installed.json

Find and replace:

"stripe listen --forward-to http://127.0.0.1:8000/spark/webhook"

With:

"stripe listen --forward-to https://www.wizbrand.com/subscription/spark/webhook"

Save the file.


3️⃣ Edit composer.lock

nano composer.lock

Find and replace:

"stripe listen --forward-to http://127.0.0.1:8000/spark/webhook"

With:

"stripe listen --forward-to https://www.wizbrand.com/subscription/spark/webhook"

Save the file.


2. Regenerate Dependencies

Since we manually changed the vendor files, prevent Composer from overwriting them.

  1. Remove composer.lock

       rm composer.lock
  2. Clear Composer Cache

       composer clear-cache
  3. Reinstall Dependencies

       composer install
  4. Verify the Fix

       grep -R "stripe listen" vendor/

    It should now show:

       "stripe listen --forward-to https://www.wizbrand.com/subscription/spark/webhook"

3. Update Webhook Registration in Stripe

Run:

php artisan cashier:webhook --url="https://www.wizbrand.com/subscription/spark/webhook"

Then go to Stripe Dashboard → Developers → Webhooks and confirm that the webhook is now correctly set.


4. Restart Laravel Services

php artisan cache:clear
php artisan config:clear
php artisan queue:restart

5. Final Testing

Run:

stripe listen --forward-to "https://www.wizbrand.com/subscription/spark/webhook"
stripe trigger invoice.payment_succeeded

Check Laravel logs:

tail -f storage/logs/laravel.log

✅ Now Your Laravel Spark Webhook is Configured for Production!

  • The stripe listen URL is updated for production.
  • Composer won’t reset it during updates.
  • Webhooks will work with Stripe’s live API.

Let me know if you need more help! 🚀