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

@@ -5,13 +5,14 @@ namespace App\Http\Controllers\Web;
use App\Http\Controllers\Controller;
use App\Models\Artwork;
use App\Services\ArtworkService;
use App\Services\Maturity\ArtworkMaturityService;
use Illuminate\Http\Request;
class DailyUploadsController extends Controller
{
protected ArtworkService $artworks;
public function __construct(ArtworkService $artworks)
public function __construct(ArtworkService $artworks, private readonly ArtworkMaturityService $maturity)
{
$this->artworks = $artworks;
}
@@ -76,11 +77,11 @@ class DailyUploadsController extends Controller
private function prepareArts($ars)
{
return $ars->map(function (Artwork $ar) {
$items = $ars->map(function (Artwork $ar): array {
$primaryCategory = $ar->categories->sortBy('sort_order')->first();
$present = \App\Services\ThumbnailPresenter::present($ar, 'md');
return (object) [
return $this->maturity->decoratePayload([
'id' => $ar->id,
'name' => $ar->title,
'thumb' => $present['url'],
@@ -88,7 +89,11 @@ class DailyUploadsController extends Controller
'gid_num' => $primaryCategory ? ((int) $primaryCategory->id % 5) * 5 : 0,
'category_name' => $primaryCategory->name ?? '',
'uname' => $ar->user->name ?? 'Skinbase',
];
});
], $ar, request()->user());
})->values()->all();
return collect($this->maturity->filterPayloadItems($items, request()->user()))
->map(static fn (array $item): object => (object) $item)
->values();
}
}