spatie / laravel-medialibrary

Associate files with Eloquent models
https://spatie.be/docs/laravel-medialibrary
MIT License
5.78k stars 1.08k forks source link

Adjust installation documentation for publishing migrations and config files #3483

Closed LuisLeguizamon closed 11 months ago

LuisLeguizamon commented 11 months ago

In order to publish migrations or config files using the 'php artisan vendor:publish --tag='' " ' command, it is necessary to adjust the tag by adding the 'package short name' with a slash (in this case, 'medialibrary-'). This adjustment is required for compatibility with the following code snippet in the PackageServiceProvider from Spatie\LaravelPackageTools: $this->publishes([ $filePath => $this->generateMigrationName( $migrationFileName, $now->addSecond() ), ], "{$this->package->shortName()}-migrations");

            $this->publishes([
                $this->package->basePath("/../config/{$configFileName}.php") => config_path("{$configFileName}.php"),
            ], "{$this->package->shortName()}-config");
freekmurze commented 11 months ago

Thanks!