feat: ship creator journey v2 and profile updates
This commit is contained in:
@@ -5,6 +5,7 @@ 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;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -13,7 +14,7 @@ class FeaturedArtworksController extends Controller
|
||||
{
|
||||
protected ArtworkService $artworks;
|
||||
|
||||
public function __construct(ArtworkService $artworks)
|
||||
public function __construct(ArtworkService $artworks, private readonly ArtworkMaturityService $maturity)
|
||||
{
|
||||
$this->artworks = $artworks;
|
||||
}
|
||||
@@ -29,7 +30,8 @@ class FeaturedArtworksController extends Controller
|
||||
/** @var LengthAwarePaginator $artworks */
|
||||
$artworks = $this->artworks->getFeaturedArtworks($typeFilter, $perPage);
|
||||
|
||||
$artworks->getCollection()->transform(function (Artwork $artwork) {
|
||||
$artworks->setCollection(
|
||||
collect($this->maturity->filterPayloadItems($artworks->getCollection()->map(function (Artwork $artwork): array {
|
||||
$primaryCategory = $artwork->categories->sortBy('sort_order')->first();
|
||||
$categoryName = $primaryCategory->name ?? '';
|
||||
$categorySlug = $primaryCategory->slug ?? '';
|
||||
@@ -37,7 +39,7 @@ class FeaturedArtworksController extends Controller
|
||||
$present = \App\Services\ThumbnailPresenter::present($artwork, 'md');
|
||||
$username = $artwork->user->username ?? $artwork->user->name ?? 'Skinbase';
|
||||
|
||||
return (object) [
|
||||
return $this->maturity->decoratePayload([
|
||||
'id' => $artwork->id,
|
||||
'name' => $artwork->title,
|
||||
'slug' => $artwork->slug,
|
||||
@@ -53,8 +55,11 @@ class FeaturedArtworksController extends Controller
|
||||
'height' => $artwork->height,
|
||||
'uname' => $artwork->user->name ?? 'Skinbase',
|
||||
'username' => $username,
|
||||
];
|
||||
});
|
||||
], $artwork, $request->user());
|
||||
})->values()->all(), $request->user()))
|
||||
->map(static fn (array $item): object => (object) $item)
|
||||
->values()
|
||||
);
|
||||
|
||||
$artworkTypes = [
|
||||
1 => 'Bronze Awards',
|
||||
|
||||
Reference in New Issue
Block a user