feat: ship creator journey v2 and profile updates

This commit is contained in:
2026-04-12 21:42:07 +02:00
parent a2457f4e49
commit d5cff21ea2
335 changed files with 20147 additions and 1545 deletions

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Services\Profile\CreatorJourneyService;
use App\Support\UsernamePolicy;
use Illuminate\Http\JsonResponse;
final class ProfileJourneyController extends Controller
{
public function __construct(private readonly CreatorJourneyService $journeys)
{
}
public function __invoke(string $username): JsonResponse
{
$normalized = UsernamePolicy::normalize($username);
$user = User::query()
->whereRaw('LOWER(username) = ?', [$normalized])
->where('is_active', true)
->whereNull('deleted_at')
->firstOrFail();
return response()->json([
'data' => $this->journeys->publicPayloadForUser($user),
'meta' => [
'username' => (string) $user->username,
'generated_at' => now()->toIso8601String(),
],
]);
}
}