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

ArchStanton's avatar

Class Mybilling\Billing\StripeBilling does not exist

I am following the Stripe Billing tutorial and rather than call it Acme as Jeffrey did I called my folder Mybilling so the structure is

- App
    -MyBilling 
        -BillingInterface.php
        -StripeBilling.php

In composer I have

    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php",
            "app/helpers.php".
            "app/Mybilling",
        ]
    },

Then I run composer update but when I try and bind in my routes file

App::bind('Mybilling\Billing\BillingInterface', 'Mybilling\Billing\StripeBilling');

I get an error

Class Mybilling\Billing\StripeBilling does not exist.

Is there somewhere else it should be added?

0 likes
3 replies
lara12664's avatar
Level 12

Is that a comma or period after helpers.php?

2 likes
Penderis's avatar

try psr4 autoload instead for the whole folder , so MyBilling will be your name space then just where needed you use MyBilling\subfoldername\class.

Could also be you are binding to MyBilling\Billing ? should it not just be MyBilling\StripeBilling.

"psr-4": {
          "MyBilling\\": "app/MyBilling"
        }

I literally just do it this way and never even run app bind because I have no idea what it does so then I just say use and follow folder structure.

So if folder is MyBilling/Subfolder/AnotherSub/File.php you use MyBilling\Subfolder\AnotherSub\File optional as else defaults to file name.

1 like

Please or to participate in this conversation.