JakeStockwell's avatar

Cashier Composer Install

Hi Laracasters! I'm building an SPA with L12 Inertia/React and want to implement payments so am looking at Cashier. Following the Laravel docs & Andre's tutorial I should install with composer require but when I do this I get a slew of errors. Am I expected to work through these errors or is there something I'm missing?

Thanks in advance & hope all's well! ;-)

0 likes
6 replies
LaryAI's avatar
Level 58

Sure! Here’s a solution you can post to that Laracasts question:


If you're getting a slew of errors when running:

composer require laravel/cashier

there are a few common causes and steps you can take to resolve the issue:

1. Check Your Laravel Version

Cashier has compatibility requirements with Laravel. If you're on Laravel 12, make sure you’re using a version of Cashier compatible with it. At the time of writing, the official docs and GitHub repo show compatibility, but always double-check.

2. Update Composer

Sometimes the errors are due to an outdated Composer version or dependency lock files. Update Composer by running:

composer self-update

Then clear cached data:

composer clear-cache

3. Update Your Dependencies

You can update your project's dependencies to the latest versions that are compatible with Laravel 12:

composer update

4. Review Your composer.json

Check your composer.json for any packages that might conflict with Cashier's requirements. Pay attention to "php" version constraints and packages like guzzlehttp/guzzle or payment gateways that could have conflicting versions.

5. Try Re-installing with All Flags

Sometimes you need to let Composer resolve dependencies:

composer require laravel/cashier --with-all-dependencies

6. Read the Error Messages Closely

The errors should tell you what dependency (or PHP version) is conflicting. Here’s an example of what to look for:

laravel/cashier 14.x requires php ^8.1 -> your PHP version (8.0.x) does not satisfy that requirement.

In this case, you’d need to update PHP on your machine.


In summary:
You should not have to manually "work through" a long list of dependency errors by yourself. Ideally, once your PHP and Composer versions are up to date and dependencies aren’t conflicting, composer require laravel/cashier should work smoothly.

If you keep having trouble, please copy and paste the actual error message(s) you receive. That will help pinpoint the problem!


Let us know exactly what errors you get if the above steps don't solve it 👍

JakeStockwell's avatar

Thanks Larry but the --with-all-dependencies flag produces the same outcome. I'm posting because the process looks really simple in the docs & tutorials so I'm surprised that it falls over so quickly, without even getting through the installation. The errors generated report issues with multiple versions of Cashier & while the docs don't provide a reference to a specific version of Cashier to install I wonder if I should be looking to add that?

JussiMannisto's avatar

You didn't include a single error message in your post. "A slew of errors" isn't actionable.

JakeStockwell's avatar

Hi Jussi, That's true, but there are quite a few... ;-)

Problem 1 - Root composer.json requires laravel/cashier * -> satisfiable by laravel/cashier[v1.0.0, v2.0.0, ..., v2.0.8, v3.0.0 , ..., v3.0.5, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v5.0.0, ..., v5.0.15, v6.0.0, ..., v6.0.20, v7.0.0, ..., v7.2.2, v8.0.0, v 8.0.1, v9.0.0, ..., v9.3.6, v10.0.0, ..., v10.7.1, v11.0.0, ..., v11.3.1, v12.0.0, ..., v12.17.2, v13.0.0, ..., v13.17.0, v14.0.0, ..., v14.14.0, v15.0.0, ..., v15.7.1, v16.0.0, ..., v16.3.0]. - laravel/cashier[v1.0.0, v2.0.0, ..., v2.0.8] require illuminate/filesystem ~4.1 -> found illuminate/filesystem[v4.1.0, ..., v4.2.17] but these were not loaded, likely because it conflicts with another require. - laravel/cashier[v9.0.0, ..., v9.3.6, v10.0.0, ..., v10.7.1] require php ^7.1.3 -> your php version (8.4.17) does not satisfy that requirement. - laravel/cashier[v11.0.0, ..., v11.3.1, v12.0.0, ..., v12.4.2] require php ^7.2 -> your php version (8.4.17) does not satisfy that requirement. - laravel/cashier[v12.6.3, ..., v12.17.0, v13.0.0, ..., v13.10.0] require dompdf/dompdf ^0.8.6|^1.0.1 -> found dompdf /dompdf[v0.8.6, v1.0.1, ..., v1.2.2] but these were not loaded, because they are affected by security advisories ("PKSA-q stp-ffwg-8hp6", "PKSA-5vz3-q51h-7mg4", "PKSA-7ztm-rpt3-qqzk", "PKSA-4jrs-y99s-q8j6", "PKSA-hbk6-2vfz-8f8n", "PKSA-kj9c-tr 41-t8mj", "PKSA-872h-8556-2chm", "PKSA-99tj-gg5v-4g74"). Go to https://packagist.org/security-advisories/ to find advisor y details. To ignore the advisories, add them to the audit "ignore" config. To turn the feature off entirely, you can set "block-insecure" to false in your "audit" config. - laravel/cashier[v12.17.1, ..., v12.17.2] require illuminate/console ^6.0|^7.0|^8.0|^9.0 -> found illuminate/console [v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require. - laravel/cashier[v7.0.11, ..., v7.2.2, v8.0.0, ..., v8.0.1, v12.5.0, ..., v12.6.1] require dompdf/dompdf ^0.8.0 -> f ound dompdf/dompdf[v0.8.0, ..., v0.8.6] but these were not loaded, because they are affected by security advisories ("PKS A-qstp-ffwg-8hp6", "PKSA-5vz3-q51h-7mg4", "PKSA-7ztm-rpt3-qqzk", "PKSA-4jrs-y99s-q8j6", "PKSA-hbk6-2vfz-8f8n", "PKSA-kj9c -tr41-t8mj", "PKSA-872h-8556-2chm", "PKSA-99tj-gg5v-4g74"). Go to https://packagist.org/security-advisories/ to find advi sory details. To ignore the advisories, add them to the audit "ignore" config. To turn the feature off entirely, you can set "block-insecure" to false in your "audit" config. - laravel/cashier v12.6.2 requires dompdf/dompdf ^0.8.4|^1.0 -> found dompdf/dompdf[v0.8.4, v0.8.5, v0.8.6, v1.0.0, . .., v1.2.2] but these were not loaded, because they are affected by security advisories ("PKSA-qstp-ffwg-8hp6", "PKSA-5vz 3-q51h-7mg4", "PKSA-7ztm-rpt3-qqzk", "PKSA-4jrs-y99s-q8j6", "PKSA-hbk6-2vfz-8f8n", "PKSA-kj9c-tr41-t8mj", "PKSA-872h-8556 -2chm", "PKSA-99tj-gg5v-4g74"). Go to https://packagist.org/security-advisories/ to find advisory details. To ignore the advisories, add them to the audit "ignore" config. To turn the feature off entirely, you can set "block-insecure" to false in your "audit" config. - laravel/cashier[v13.10.1, ..., v13.12.0] require dompdf/dompdf ^1.2.1 -> found dompdf/dompdf[v1.2.1, v1.2.2] but th ese were not loaded, because they are affected by security advisories ("PKSA-qstp-ffwg-8hp6", "PKSA-5vz3-q51h-7mg4", "PKS A-7ztm-rpt3-qqzk", "PKSA-4jrs-y99s-q8j6", "PKSA-hbk6-2vfz-8f8n", "PKSA-kj9c-tr41-t8mj", "PKSA-872h-8556-2chm"). Go to htt ps://packagist.org/security-advisories/ to find advisory details. To ignore the advisories, add them to the audit "ignore" config. To turn the feature off entirely, you can set "block-insecure" to false in your "audit" config. - laravel/cashier[v13.13.0, ..., v13.16.0] require illuminate/console ^8.37|^9.0 -> found illuminate/console[v8.37.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
- laravel/cashier v13.17.0 requires illuminate/console ^8.37|^9.0|^10.0 -> found illuminate/console[v8.37.0, ..., v8. 83.27, v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.49.0] but these were not loaded, likely because it conflicts with another require. - laravel/cashier[v14.7.0, ..., v14.14.0] require illuminate/console ^9.21|^10.0 -> found illuminate/console[v9.21.0, ..., v9.52.16, v10.0.0, ..., v10.49.0] but these were not loaded, likely because it conflicts with another require.
- laravel/cashier[v14.0.0, ..., v14.6.0] require illuminate/console ^9.21 -> found illuminate/console[v9.21.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require. - laravel/cashier[v15.0.0, ..., v15.1.1] require illuminate/console ^10.0 -> found illuminate/console[v10.0.0, ..., v10.49.0] but these were not loaded, likely because it conflicts with another require. - laravel/cashier[v15.2.0, ..., v15.7.1, v16.0.0, ..., v16.3.0] require moneyphp/money ^4.0 -> satisfiable by moneyphp/money[v4.0.0, ..., v4.8.0]. - laravel/cashier[v3.0.0, ..., v3.0.5, v4.0.0, ..., v4.0.3, v5.0.0, ..., v5.0.15] require illuminate/filesystem ~5.0 -> found illuminate/filesystem[v5.0.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require. - laravel/cashier[v6.0.0, ..., v6.0.20] require illuminate/database ~5.1 -> found illuminate/database[v5.1.1, ..., v5 .8.36] but these were not loaded, because they are affected by security advisories ("PKSA-zrgd-gjq7-6ykr"). Go to https:/ /packagist.org/security-advisories/ to find advisory details. To ignore the advisories, add them to the audit "ignore" config. To turn the feature off entirely, you can set "block-insecure" to false in your "audit" config. - laravel/cashier[v7.0.0, ..., v7.0.10] require illuminate/database ~5.3 -> found illuminate/database[v5.3.0, ..., v5 .8.36] but these were not loaded, because they are affected by security advisories ("PKSA-zrgd-gjq7-6ykr"). Go to https:/ /packagist.org/security-advisories/ to find advisory details. To ignore the advisories, add them to the audit "ignore" config. To turn the feature off entirely, you can set "block-insecure" to false in your "audit" config. - moneyphp/money[v4.0.0, ..., v4.8.0] require ext-bcmath * -> it is missing from your system. Install or enable PHP's bcmath extension.

  Alternatively you can require one of these packages that provide the extension (or parts of it):
  Keep in mind that the suggestions are automated and may not be valid or safe to use
  - phpseclib/bcmath_compat PHP 5.x-8.x polyfill for bcmath extension
  - nanasess/bcmath-polyfill PHP 8.4 bcmath functions polyfill with fallback compatibility for environments without bcmath extens
  - lumisys/bcmath_compat PHP 5.x/7.x polyfill for bcmath extension

- moneyphp/money[v4.0.4, ..., v4.0.5] require php ~8.0.0 || ~8.1.0 -> your php version (8.4.17) does not satisfy that requirement.
- moneyphp/money[v4.1.0, ..., v4.2.0] require php ~8.0.0 || ~8.1.0 || ~8.2.0 -> your php version (8.4.17) does not satisfy that requirement.
- moneyphp/money[v4.3.0, ..., v4.4.0] require php ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 -> your php version (8.4.17) does not satisfy that requirement.
- moneyphp/money[v4.5.0, ..., v4.5.1] require php ~8.1.0 || ~8.2.0 || ~8.3.0 -> your php version (8.4.17) does not satisfy that requirement.
JussiMannisto's avatar

That error output is quite unreadable in its unformatted state. This forum supports GitHub-style markdown. You should paste the errors in a code block using backtics:

```
Errors here
```

That said, I can see that you're (at least) missing the ext-bcmath PHP extension, which is required by moneyphp/money, which in turn is required by laravel/cashier. I'd start by installing the extension, then seeing if you have other dependency issues.

JakeStockwell's avatar

Thanks Jussi. It is a mess, and not what one would hope to see when following a pretty simple instruction in a tutorial, which is why I posted I guess, not necessarily looking for an answer but pointing out that the Cashier tutorial could maybe start with 'make sure you have these PHP extensions' installed or something. Thanks for your input & sorry if I've wasted your time. ;-)

Please or to participate in this conversation.