feat(profile): add uploadable avatars with local/S3 storage

Users can upload and remove profile pictures on the profile page.
Admins choose local or instance S3 storage in advanced settings.
Avatars are compressed to JPEG and served via a private cached route.
This commit is contained in:
Andras Bacsai
2026-08-07 21:39:56 +02:00
parent e50108a905
commit 51561e4bee
23 changed files with 677 additions and 44 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers;
use App\Services\AvatarStorageService;
use Illuminate\Http\Response;
class ProfileAvatarController extends Controller
{
public function __invoke(AvatarStorageService $avatarStorage): Response
{
$contents = $avatarStorage->contents(auth()->user());
abort_if($contents === null, 404);
return response($contents, 200, [
'Content-Type' => 'image/jpeg',
'Cache-Control' => 'private, max-age=300',
]);
}
}