spatie / laravel-medialibrary

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

Publishing the views is not working or not documented #3567

Closed omarherri closed 8 months ago

omarherri commented 8 months ago

To customizing the rendered HTML i tried to publish the view as mentioned in the documentation using:

php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="views"

But this returned No publishable resources for tag [views].

patinthehat commented 8 months ago

@omarherri Have you tried running

php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-views"

This follows the same format as the other publish commands, even though the docs indicate "views" as the correct tag. Please let me know if you still run into an issue, and I'll dig in and get to the bottom of it! :+1:

omarherri commented 8 months ago

@patinthehat, I tried your solution, but I still received the same message: "No publishable resources for tag [medialibrary-views]."

So, I looked up the package and noticed that the views are declared under the 'media-library' name in the service provider. Therefore, I modified the command to:

php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="media-library-views"

And it worked for me! Thank you for pointing me in the right direction.

patinthehat commented 8 months ago

@omarherri thank you for the update, I'll update the docs accordingly! :+1: