wesamly
wesamly

Reputation: 1584

Laravel package's composer require

I have created a package for Laravel, the package is using its own composer.json for specifying requirements. The problem is how to make Laravel's composer to "include" the package's composer requirements? so that when I run composer update the package requirements installed along with the app requirements.

I used normal composer for package:

Path: app/packages/intropkg/composer.json

"require": { "spatie/emoji": "^1.0" },

but when calling the package from Laravel I get the error: Class 'Spatie\Emoji\Emoji' not found

Laravel composer related config:

Path: app/composer.json

"autoload": { ... "psr-4": { "App\\": "app/", "Lsdev\\Intropkg\\": "packages/intropkg/src" } }

Upvotes: 1

Views: 274

Answers (1)

Nico Haase
Nico Haase

Reputation: 12126

Have you called composer update (not install!) after editing composer.json? Just running install will not pick up new dependencies

Upvotes: 0

Related Questions