spatie / laravel-query-builder

Easily build Eloquent queries from API requests
https://spatie.be/docs/laravel-query-builder
MIT License
4.06k stars 397 forks source link

Config file publish documented is incorrect #738

Closed Bosphoramus closed 2 years ago

Bosphoramus commented 2 years ago

Docs say that the publish command for the configuration file is php artisan vendor:publish --provider="Spatie\QueryBuilder\QueryBuilderServiceProvider" --tag="query-builder-config"

But it doesnt work, its actually php artisan vendor:publish --provider="Spatie\QueryBuilder\QueryBuilderServiceProvider"

dominikb commented 2 years ago

Hi đź‘‹

Did you check out issue #729? Are you using version 5 of this package?

The --tag parameter in the command narrows the scope of the published resources and can be omitted in this case. Check out the docs on Laravel - Publish file groups for more information on that.

Bosphoramus commented 2 years ago

I see, thank you! @dominikb So… shouldnt the documentation be adjusted to suggest the command without the —tag parameter, so some file gets published? Its weird to follow the installation options, and at the moment you try to publish the config file you get “No configuration files to publish”, when the docs clearly state that you have to use that command if you want to publish the config file.

dominikb commented 2 years ago

Are you using the same version as in the documentation? Publishing older versions with this command will not work. I just tried it with v5 and this was my output. I think the documentation is correct.

composer create-project laravel/laravel test-laravel-query-builder
cd test-laravel-query-builder
composer require spatie/laravel-query-builder 

php artisan vendor:publish --provider="Spatie\QueryBuilder\QueryBuilderServiceProvider" --tag="query-builder-config"

Copied File [/vendor/spatie/laravel-query-builder/config/query-builder.php] To [/config/query-builder.php] Publishing complete.

Bosphoramus commented 2 years ago

Id swear it was the latest query builder version on Laravel 8 instead of 9

spatie-bot commented 2 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.