redesign
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user