0

I have a Laravel project that uses this library BeyondCode\\LaravelWebSockets

It was installed like that: composer require beyondcode/laravel-websockets

But I had to modify it so I've made a copy and set the autoload to point to my modified copy:

"autoload": {
  "psr-4": {
    "App\\": "app/",
    "Database\\Factories\\": "database/factories/",
    "Database\\Seeders\\": "database/seeders/",
    "BeyondCode\\LaravelWebSockets\\": "packages/laravel-websockets"
  }
},

Somehow it works on my local environment but when I try to run composer install or composer dump-autoload on production the new files are skipped because the location doesn't match the PSR-4 standart.

This way the paths described in ./vendor/composer/autoload_static.php and ./vendor/composer/autoload_classmap.php keep on pointing to the original library.

Is there a way to ignore PSR-4 requirement for this specific library?

emppeak
  • 158
  • 12
Samuil Banti
  • 1,735
  • 1
  • 15
  • 26
  • What do you mean by "I had to modify it"? If you don't want to use the code provided by that library, remove it from your `composer.json`. Why not properly use the library and extend it through the common ways of the service container (as in: extending or decorating a service)? – Nico Haase Jan 20 '21 at 10:08
  • Unfortunately the type of the changes don't allow me to easely extend it. – Samuil Banti Jan 20 '21 at 10:12
  • 2
    You are doing this wrong. You need to define a custom local repository with your local copy/fork. – yivi Jan 20 '21 at 10:27

0 Answers0