21

我曾尝试使用

php artisan vendor:publish --provider="BeyondCode\LaravelWebSockets\WebSocketsServiceProvider" --tag="migrations"

但我得到

Unable to locate publishable resources

publishing complete

我不知道问题的原因是什么。任何可以帮助我的人。

安装输出

Installing beyondcode/laravel-websockets (1.4.0): Downloading (100%)
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
symfony/psr-http-message-bridge suggests installing nyholm/psr7 (For a super lightweight PSR-7/17 implementation)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/dependency-injection
react/event-loop suggests installing ext-event (~1.0 for ExtEventLoop)
react/event-loop suggests installing ext-pcntl (For signal handling support when using the StreamSelectLoop)
react/event-loop suggests installing ext-uv (* for ExtUvLoop)
paragonie/sodium_compat suggests installing ext-libsodium (PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.)
paragonie/sodium_compat suggests installing ext-sodium (PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.)
voku/portable-ascii suggests installing ext-intl (Use Intl for transliterator_transliterate() support)
symfony/translation suggests installing symfony/config
symfony/translation suggests installing symfony/yaml
illuminate/support suggests installing moontoast/math (Required to use ordered UUIDs (^1.1).)
illuminate/support suggests installing ramsey/uuid (Required to use Str::uuid() (^3.7).)
illuminate/support suggests installing vlucas/phpdotenv (Required to use the Env class and env helper (^4.0).)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
illuminate/filesystem suggests installing league/flysystem (Required to use the Flysystem local and FTP drivers (^1.0).)
illuminate/filesystem suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (^1.0).)
illuminate/filesystem suggests installing league/flysystem-cached-adapter (Required to use the Flysystem cache (^1.0).)
illuminate/filesystem suggests installing league/flysystem-sftp (Required to use the Flysystem SFTP driver (^1.0).)
illuminate/http suggests installing guzzlehttp/guzzle (Required to use the HTTP Client (^6.3.1|^7.0).)
illuminate/routing suggests installing nyholm/psr7 (Required to use PSR-7 bridging features (^1.2).)
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/lock
illuminate/console suggests installing dragonmantank/cron-expression (Required to use scheduler (^2.0).)
illuminate/console suggests installing guzzlehttp/guzzle (Required to use the ping methods on schedules (^6.3.1|^7.0).)
illuminate/database suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (^2.6).)
illuminate/database suggests installing fzaninotto/faker (Required to use the eloquent factory builder (^1.4).)
illuminate/database suggests installing illuminate/events (Required to use the observers with Eloquent (^7.0).)
illuminate/database suggests installing illuminate/pagination (Required to paginate the result set (^7.0).)
illuminate/queue suggests installing ext-pcntl (Required to use all features of the queue worker.)
illuminate/queue suggests installing ext-posix (Required to use all features of the queue worker.)
illuminate/queue suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and DynamoDb failed job storage (^3.0).)
illuminate/queue suggests installing illuminate/redis (Required to use the Redis queue driver (^7.0).)
illuminate/queue suggests installing pda/pheanstalk (Required to use the Beanstalk queue driver (^4.0).)
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
Writing lock file
Generating autoload files
4

12 回答 12

28
  1. 首次运行命令:

    php artisan vendor:publish
    

您将看到要发布的内容列表:

在此处输入图像描述


  1. 通过提供索引号选择您要发布的内容。如果是迁移,输入 20 并输入;如果是配置文件,输入 12 并输入等。

我希望这能解决你的错误。

于 2021-06-06T07:56:05.323 回答
13

这完全是关于运行这个命令'php artisan vendor:publish --provider',然后选择引用你想要发布的文件的数字。

于 2020-11-02T20:00:39.773 回答
11

我遇到了同样的问题,现在解决了,这里是怎么回事 在此处输入图像描述

执行以下命令集:

php artisan clear-compiled
composer dumpautoload

之后我的php artisan vendor:publish --provider="Path\To\Class"运行成功。

请参阅下面的完整屏幕截图 在此处输入图像描述

这个链接很有帮助。

于 2020-08-21T19:25:21.607 回答
5

我通过运行解决了它composer update

于 2020-10-20T07:44:19.760 回答
2

尝试运行命令:

php工匠供应商:发布

然后选择你要发布的包...我希望它能解决你的问题。

于 2021-05-24T05:13:33.423 回答
2

我有同样的问题..但就我而言,我只是忘记ServiceProviderapp.php

于 2021-02-18T16:36:13.823 回答
2

它解决了我的问题:

php artisan config:cache

接着

php artisan vendor:publish

选择提供者的号码,您就完成了。

于 2021-09-20T15:10:23.113 回答
1

先生,我也遇到了同样的问题,我解决了:

尝试只运行php artisan vendor:publish,你会看到所有可发布的,然后你可以根据列表的数量选择你需要的。

于 2021-05-24T17:10:14.217 回答
0

我也面临同样的问题。所以我关闭了命令终端并重试。它的工作。

于 2021-01-25T11:08:07.293 回答
0

在本地安装作曲家,然后进行作曲家安装。

于 2020-09-12T04:57:42.443 回答
0

我遇到了同样的问题,我尝试了所有解决方案,但没有一个有效..

我只是忘记了第一次运行:composer require laravel/sanctum

之后,我必须运行:composer update 然后我能够执行:php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"

于 2021-02-07T15:14:13.897 回答
0

我在 Docker 容器中使用 Laravel,所以我创建了 BASH 脚本来从任何地方调用“php artisan”,这个脚本只是从 artisan 命令中截断双引号(“)。当在 docker 容器中手动运行时,它会按预期工作。

于 2021-02-21T18:47:42.707 回答