This commit is contained in:
2026-05-15 23:06:44 +03:30
parent 41789ec221
commit 97485b7a67
22 changed files with 1609 additions and 665 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Models\Category;
use App\Models\Channel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Inertia\Inertia;
use Inertia\Response;
use Laravel\Fortify\Features;
@@ -46,6 +47,9 @@ class HomeController extends Controller
'display_name' => $channel->display_name,
'description' => $channel->description,
'thumbnail_path' => $channel->thumbnail_path,
'thumbnail_url' => $this->mediaUrl($channel->thumbnail_path),
'avatar_url' => $this->mediaUrl($channel->avatar_path),
'banner_url' => $this->mediaUrl($channel->banner_path),
'viewer_count' => $channel->viewer_count,
'followers_count' => $channel->follows_count ?? 0,
'category' => $channel->category ? [
@@ -64,4 +68,9 @@ class HomeController extends Controller
],
];
}
private function mediaUrl(?string $path): ?string
{
return $path ? Storage::url($path) : null;
}
}