aws / aws-sdk-php-laravel

A Laravel 5+ (and 4) service provider for the AWS SDK for PHP
http://aws.amazon.com/sdkforphp/
Apache License 2.0
1.65k stars 245 forks source link

php artisan vendor:publish command says "Unable to locate publishable resources." #214

Closed commadelimited closed 1 month ago

commadelimited commented 2 years ago

Describe the bug

I have a Lumen 8.0 app into which I'm trying to install this SDK.

1) I install via composer: composer require aws/aws-sdk-php-laravel 2) I add this line ($app->register(Aws\Laravel\AwsServiceProvider::class);) to bootstrap/app.php 3) I confirm I have the proper environment variables in place 4) I run php artisan vendor:publish --provider="Aws\Laravel\AwsServiceProvider" 5) I get this output: Unable to locate publishable resources. Publishing complete.

I tried manually importing that class:

use Aws\Laravel\AwsServiceProvider;
$app->register(AwsServiceProvider::class);
// and nothing

I tried running composer dumpautoload and then the vendor command and nothing.

I've found posts on Stack Overflow which suggest running the php artisan vendor:publish alone. That command output does not include anything related to AWS.

I even tried this suggestion found on the Lumen Vendor Publish package: https://github.com/laravelista/lumen-vendor-publish/issues/16#issuecomment-917424678

Can you offer any insights into why this might be failing? I suspect I could simply copy vendor/aws/aws-sdk-php-laravel/config/aws_publish.php into my config/ directory as aws.php but given you have specific instructions for Lumen I thought I'd ask here first.

Expected Behavior

I expected the file config/aws.php to be created as per the instructions in the readme.

Current Behavior

When I run this command:

$ php artisan vendor:publish  --provider="Aws\Laravel\AwsServiceProvider"

I get the following output:

Unable to locate publishable resources.
Publishing complete.

Reproduction Steps

1) I install via composer: composer require aws/aws-sdk-php-laravel 2) I add this line ($app->register(Aws\Laravel\AwsServiceProvider::class);) to bootstrap/app.php 3) I confirm I have the proper environment variables in place 4) I run php artisan vendor:publish --provider="Aws\Laravel\AwsServiceProvider" 5) I get this output: Unable to locate publishable resources. Publishing complete.

Possible Solution

It appears that the publish command can't find the package, but it's clearly there when viewing the vendor folder.

Additional Information/Context

No response

SDK version used

3.7

Environment details (OS name and version, etc.)

Mac OS 10.15.7 (19H1615)

yenfryherrerafeliz commented 1 year ago

Hi @commadelimited, sorry for the delay on this. Can you please confirm if you are still having this issue so we can assist you further?

Thanks!

github-actions[bot] commented 1 year ago

This issue has not recieved a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

Shrikant-28 commented 1 year ago

Hi @commadelimited, I have tried another way. I have registered "AwsServiceProvider" inside config/app.php in 'Autoloaded Service Providers' section Aws\Laravel\AwsServiceProvider::class,

After registering using composer dump-autoload command

If want to check publishable assets use command php artisan vendor:publish

You will see
Provider: Aws\Laravel\AwsServiceProvider ....................................................................................................... 1 and Tag: aws-config ............................................................................................................................................................ 10

Type the sequence number of Provider or Tag and hit enter. You will see aws.php file copied inside config folder.

image image

RanVaknin commented 2 months ago

Hi @commadelimited ,

Can you please check the workaround provided by @Shrikant-28 and see if this solves your issue?

Thanks, Ran~

commadelimited commented 2 months ago

Sorry but I no longer have access to that code bae. Please feel free to close this ticket if you like.

github-actions[bot] commented 1 month ago

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.