Skip to content

Conversation

@Barata-Ribeiro
Copy link
Owner

@Barata-Ribeiro Barata-Ribeiro commented Nov 22, 2025

This PR introduces full integration with spatie/laravel-medialibrary to manage user media, specifically user avatars. It removes the old imageable implementation, prepares the database, updates the User model, adds a dedicated frontend upload component, and integrates avatar handling into the profile update flow. Avatars are now generated in webp format for improved performance.

Commits included (9):

  • chore: install spatie/laravel-medialibrary
  • remove(imageable): delete obsolete imageable model
  • feat(media): prepare database and publish config
  • feat(user): implement media handling with Media Library
  • feat(avatar): add AvatarUpload component
  • feat(media): update User model with avatar property and adjustments
  • feat(profile): add avatar upload functionality to profile update
  • feat(profile): integrate AvatarUpload into profile update flow
  • feat(user): switch avatar handling to webp and improve UX
  • refactor(file-upload): simplify file validation and improve handling of multiple file uploads

Files changed: 28
Commits: 10

Motivation

  • Replace outdated custom image handling with a modern and well-maintained media package.
  • Standardize avatar storage and support image transformations (webp).
  • Introduce a reusable frontend component for avatar uploads.
  • Improve performance and reduce image payload sizes.

What’s included

  • Composer installation of Spatie Media Library.
  • Publishing of migrations and configuration files.
  • Removal of the legacy imageable model.
  • User model updated to use HasMedia and InteractsWithMedia.
  • New media collection avatars with webp conversion.
  • New frontend component AvatarUpload for image selection & preview.
  • Updated profile controller/logic to persist avatar media.
  • Validation rules and error handling improvements throughout the flow.

@Barata-Ribeiro Barata-Ribeiro self-assigned this Nov 22, 2025
@Barata-Ribeiro Barata-Ribeiro added the enhancement New feature or request label Nov 22, 2025
@Barata-Ribeiro Barata-Ribeiro merged commit b593f09 into main Nov 22, 2025
2 checks passed
@Barata-Ribeiro Barata-Ribeiro deleted the implement-spatie-laravel-medialibrary branch November 22, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants