devaslanphp / auto-translate

Automatically generate translation JSON files for your Laravel project
MIT License
61 stars 10 forks source link

HOW TO FIX THIS ERROR: No publishable resources for tag [auto-translate-config] and "Spatie\LaravelPackageTools\PackageServiceProvider" not found ??? #2

Open chegmarco1989 opened 1 year ago

chegmarco1989 commented 1 year ago

Hello.

After installing the package on Laravel 9 and adding the package in provider array into config/app.php:

\Devaslanphp\AutoTranslate\AutoTranslateProvider::class,

When I try to publish package doing this:

php artisan vendor:publish --tag=auto-translate-config

I get this error:

In AutoTranslateProvider.php line 10:

  Class "Spatie\LaravelPackageTools\PackageServiceProvider" not found

But when I comment it like this:

// \Devaslanphp\AutoTranslate\AutoTranslateProvider::class,

And repeat this:

php artisan vendor:publish --tag=auto-translate-config

I get:

INFO No publishable resources for tag [auto-translate-config].

How to fix this error ???

riansyh commented 1 year ago

Hello.

After installing the package on Laravel 9 and adding the package in provider array into config/app.php:

\Devaslanphp\AutoTranslate\AutoTranslateProvider::class,

When I try to publish package doing this:

php artisan vendor:publish --tag=auto-translate-config

I get this error:

In AutoTranslateProvider.php line 10:

  Class "Spatie\LaravelPackageTools\PackageServiceProvider" not found

But when I comment it like this:

// \Devaslanphp\AutoTranslate\AutoTranslateProvider::class,

And repeat this:

php artisan vendor:publish --tag=auto-translate-config

I get:

INFO No publishable resources for tag [auto-translate-config].

How to fix this error ???

you can try to run this command to install the laravel-package-tools composer require spatie/laravel-package-tools or if there is any error, you can try the following command: composer require spatie/laravel-package-tools:*

I had the same error as you, but after running the command, it worked in my project.

tfranssen commented 5 months ago

I guess it is not working for laravel 11

jeffersonsimaogoncalves commented 5 months ago

Open PR #7.

Adjust this dependency on spatie/laravel-package-tools.