Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hellomars's avatar

Can't update Cashier in order to update Stripe-php in order to install Laravel-shield

Dear Sparkers,

A while ago, I tried to install a shield package to verify the origin of Stripe webhooks:

https://laracasts.com/discuss/channels/spark/middleware-to-protect-against-unverified-webhooks-from-3rd-party-services-fails-to-install?page=1#reply-382098

Since then, I didn't really look into it until now. I tried to update the Stripe-php but that package was linked tot Cashier 7.0.1. So I tried to update Cashier since there are about 12 updates since 7.0.1 but that gives me a ton of conflicts (listed underneath).

So I am wondering, is it even possible to update all of this without breaking the whole Spark functionality? I am running the latest v5.0.1 Spark with Laravel 5.5

Thanks

Using version ^7.0 for laravel/cashier
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package stripe/stripe-php (locked at v3.23.0, required as ^5.9) is satisfiable by stripe/stripe-php[v3.23.0] but these conflict with your requirements or minimum-stability.
  Problem 2
    - laravel/cashier v7.0.11 requires dompdf/dompdf ^0.8.0 -> satisfiable by dompdf/dompdf[v0.8.0, v0.8.1, v0.8.2].
    - laravel/cashier v7.0.12 requires dompdf/dompdf ^0.8.0 -> satisfiable by dompdf/dompdf[v0.8.0, v0.8.1, v0.8.2].
    - laravel/cashier v7.0.13 requires dompdf/dompdf ^0.8.0 -> satisfiable by dompdf/dompdf[v0.8.0, v0.8.1, v0.8.2].
    - laravel/cashier v7.0.1 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.9 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.8 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.7 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.6 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.5 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.4 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.3 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.2 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - dompdf/dompdf v0.8.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - dompdf/dompdf v0.8.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - dompdf/dompdf v0.8.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - laravel/cashier v7.0.10 requires stripe/stripe-php ~4.0 -> satisfiable by stripe/stripe-php[v4.0.0, v4.0.1, v4.1.0, v4.1.1, v4.10.0, v4.11.0, v4.12.0, v4.13.0, v4.2.0, v4.3.0, v4.4.0, v4.4.1, v4.4.2, v4.5.0, v4.5.1, v4.6.0, v4.7.0, v4.8.0, v4.8.1, v4.9.0, v4.9.1] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.1 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.0 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - laravel/cashier v7.0.1 requires stripe/stripe-php ~3.0 -> satisfiable by stripe/stripe-php[v3.0.0, v3.1.0, v3.10.0, v3.10.1, v3.11.0, v3.12.0, v3.12.1, v3.13.0, v3.14.0, v3.14.1, v3.14.2, v3.14.3, v3.15.0, v3.16.0, v3.17.0, v3.17.1, v3.18.0, v3.19.0, v3.2.0, v3.20.0, v3.21.0, v3.22.0, v3.23.0, v3.3.0, v3.4.0, v3.5.0, v3.6.0, v3.7.0, v3.7.1, v3.8.0, v3.9.0, v3.9.1, v3.9.2] but these conflict with your requirements or minimum-stability.
    - Installation request for laravel/cashier ^7.0 -> satisfiable by laravel/cashier[v7.0.0, v7.0.1, v7.0.10, v7.0.11, v7.0.12, v7.0.13, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.0.9].

  To enable extensions, verify that they are enabled in your .ini files:```

0 likes
2 replies
martinbean's avatar
Level 80

@hellomars There isn’t much to verifying a Stripe webhook; it certainly doesn’t require a third-party package to do so.

You can create a middleware and add the example check from Stripe’s documentation: https://stripe.com/docs/webhooks#verify-official-libraries

(In the PHP example, if you place the code in your middleware’s handle() method, then replace http_response_code(200); with return $next($request);.)

1 like
hellomars's avatar

Thanks Martin, that is a very good suggestion. I am now trying to get the code to work within my Spark environment. This piece of code is proving difficult:

$event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret

I can find it back in the official repos: https://github.com/stripe/stripe-php/search?utf8=%E2%9C%93&q=constructEvent&type= but I guess the Spark installation uses an outdated Stripe package.

Since I am having difficulty getting the package updated, I will try to get all the necessary files in.... it's a bit of a hack....

Please or to participate in this conversation.