Homepage
- Add HomepageService with hero, trending (award-weighted), fresh uploads,
popular tags, creator spotlight (weekly uploads ranking), and news sections
- Add React components: HomePage, HomeHero, HomeTrending, HomeFresh,
HomeTags, HomeCreators, HomeNews (lazy-loaded below the fold)
- Wire home.blade.php with JSON props, SEO meta, JSON-LD, and hero preload
- Add HomePage.jsx to vite.config.js inputs
Profile page
- Hero banner with random user artwork as background + dark gradient overlay
- Favourites section uses real Artwork models + <x-artwork-card> for CDN URLs
- Newest artworks grid: gallery-grid → grid grid-cols-2 gap-4
Edit Profile page (user.blade.php)
- Add hero banner (featured wallpaper/photography via artwork_features,
content_type_id IN [2,3]) sourced in UserController
- Remove bg-deep from outer wrapper; card backgrounds: bg-panel → bg-nova-800
- Remove stray AI-generated tag fragment from template
Author profile links
- Fix all /@username routes in: HomepageService, MonthlyCommentatorsController,
LatestCommentsController, MyBuddiesController and corresponding blade views
Legacy view namespace
- Register View::addNamespace('legacy', resource_path('views/_legacy'))
in AppServiceProvider::boot()
- Convert all view('legacy.x') and @include('legacy.x') calls to legacy::x
- Migrate legacy views to resources/views/_legacy/ with namespace support
59 lines
1.9 KiB
PHP
59 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Legacy;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use App\Services\ArtworkService;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
protected ArtworkService $artworks;
|
|
|
|
public function __construct(ArtworkService $artworks)
|
|
{
|
|
$this->artworks = $artworks;
|
|
}
|
|
|
|
public function index(Request $request)
|
|
{
|
|
$page_title = 'Skinbase - Photography, Skins & Wallpapers';
|
|
$page_meta_description = 'Skinbase legacy home, rendered via Laravel.';
|
|
$page_meta_keywords = 'wallpapers, skins, photography, community';
|
|
|
|
// Use new ArtworkService as primary data source
|
|
$featuredResult = $this->artworks->getFeaturedArtworks(null, 39);
|
|
// If service returned a paginator, extract the first model for the single "featured" slot
|
|
if ($featuredResult instanceof \Illuminate\Pagination\LengthAwarePaginator) {
|
|
$featured = $featuredResult->getCollection()->first();
|
|
} elseif (is_array($featuredResult)) {
|
|
$featured = $featuredResult[0] ?? null;
|
|
} else {
|
|
// Collection or single item
|
|
$featured = method_exists($featuredResult, 'first') ? $featuredResult->first() : $featuredResult;
|
|
}
|
|
|
|
// Provide a memberFeatured fallback so the legacy view always has a value
|
|
$memberFeatured = $featured;
|
|
|
|
$latestUploads = $this->artworks->getLatestArtworks(20);
|
|
|
|
// Legacy forum/news data not available in new services yet — provide empty defaults
|
|
$forumNews = [];
|
|
$ourNews = [];
|
|
$latestForumActivity = [];
|
|
|
|
return view('legacy::home', compact(
|
|
'page_title',
|
|
'page_meta_description',
|
|
'page_meta_keywords',
|
|
'featured',
|
|
'memberFeatured',
|
|
'latestUploads',
|
|
'forumNews',
|
|
'ourNews',
|
|
'latestForumActivity'
|
|
));
|
|
}
|
|
}
|