Skip to content

Configuration Overwrite on each composer update #6645

Closed
@toitzi

Description

@toitzi

API Platform version(s) affected: 4.0.1

Description
The configuration file for this package is published within the laravel-assets group on this line. However, it should not be part of this group. By default, Laravel republishes assets during each composer update, which is appropriate for assets but not for configuration files, as the config file would be overwritten each time.

Additionally, the package uses this group for asset publishing. While this isn't necessarily incorrect, it’s worth noting that the laravel-assets group seems reserved for Laravel packages. According to the official Laravel documentation, it’s recommended to use the public group for assets instead. This change is important since Laravel no longer copies vendor files and configs by default, a practice that is discouraged starting with Laravel 11.

How to reproduce
Edit the config file, then run composer update — the config file will revert to the original version from the package.

Possible Solution
Remove the config file from the laravel-assets group and switch the asset publishing to the public group. It would also be beneficial to update the documentation accordingly. This adjustment will prevent the files from being published automatically, which is unnecessary. If users wish to modify these files, they can publish them manually using commands like php artisan vendor:publish --tag=api-platform-config

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions