简体   繁体   English

Laravel包的作曲家要求

[英]Laravel package's composer require

I have created a package for Laravel, the package is using its own composer.json for specifying requirements. 我已经为Laravel创建了一个程序包,该程序包使用自己的composer.json来指定需求。 The problem is how to make Laravel's composer to "include" the package's composer requirements? 问题是如何使Laravel的作曲家“包括”包装的作曲家要求? so that when I run composer update the package requirements installed along with the app requirements. 这样,当我运行composer时,会更新安装的软件包要求以及应用程序要求。

I used normal composer for package: 我使用普通的作曲家包装:

Path: app/packages/intropkg/composer.json 路径: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调用程序包时出现错误:找不到类'Spatie \\ Emoji \\ Emoji'

Laravel composer related config: Laravel作曲家相关的配置:

Path: app/composer.json 路径:app / composer.json

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

Have you called composer update (not install !) after editing composer.json ? 在编辑composer.json之后,您是否致电过composer update (未install !)? Just running install will not pick up new dependencies 仅运行install不会获取新的依赖项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM