redesign
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Models\Broadcast;
|
||||
use App\Models\Channel;
|
||||
use App\Models\User;
|
||||
use App\Models\Vod;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
@@ -34,6 +35,7 @@ class AdminDashboardController extends Controller
|
||||
'id' => $broadcast->channel->id,
|
||||
'slug' => $broadcast->channel->slug,
|
||||
'display_name' => $broadcast->channel->display_name,
|
||||
'thumbnail_url' => $this->mediaUrl($broadcast->channel->thumbnail_path),
|
||||
'owner' => $broadcast->channel->user->name,
|
||||
],
|
||||
]),
|
||||
@@ -46,6 +48,8 @@ class AdminDashboardController extends Controller
|
||||
'id' => $channel->id,
|
||||
'slug' => $channel->slug,
|
||||
'display_name' => $channel->display_name,
|
||||
'avatar_url' => $this->mediaUrl($channel->avatar_path),
|
||||
'thumbnail_url' => $this->mediaUrl($channel->thumbnail_path),
|
||||
'is_live' => $channel->is_live,
|
||||
'suspended_at' => $channel->suspended_at?->toIso8601String(),
|
||||
'owner' => [
|
||||
@@ -55,4 +59,9 @@ class AdminDashboardController extends Controller
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
private function mediaUrl(?string $path): ?string
|
||||
{
|
||||
return $path ? Storage::url($path) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Models\Channel;
|
||||
use App\Models\ChatMessage;
|
||||
use App\Models\Vod;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
@@ -26,6 +27,9 @@ class ChannelController extends Controller
|
||||
'slug' => $channel->slug,
|
||||
'display_name' => $channel->display_name,
|
||||
'description' => $channel->description,
|
||||
'avatar_url' => $this->mediaUrl($channel->avatar_path),
|
||||
'banner_url' => $this->mediaUrl($channel->banner_path),
|
||||
'thumbnail_url' => $this->mediaUrl($channel->thumbnail_path),
|
||||
'is_live' => $channel->is_live,
|
||||
'viewer_count' => $channel->viewer_count,
|
||||
'followers_count' => $channel->follows_count,
|
||||
@@ -84,4 +88,9 @@ class ChannelController extends Controller
|
||||
: false,
|
||||
]);
|
||||
}
|
||||
|
||||
private function mediaUrl(?string $path): ?string
|
||||
{
|
||||
return $path ? Storage::url($path) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ use App\Models\Channel;
|
||||
use App\Services\Streaming\StreamKeyManager;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Inertia\Inertia;
|
||||
@@ -165,6 +166,9 @@ class CreatorDashboardController extends Controller
|
||||
'slug' => $channel->slug,
|
||||
'display_name' => $channel->display_name,
|
||||
'description' => $channel->description,
|
||||
'avatar_url' => $this->mediaUrl($channel->avatar_path),
|
||||
'banner_url' => $this->mediaUrl($channel->banner_path),
|
||||
'thumbnail_url' => $this->mediaUrl($channel->thumbnail_path),
|
||||
'is_live' => $channel->is_live,
|
||||
'viewer_count' => $channel->viewer_count,
|
||||
'stream_key_last_used_at' => $channel->streamKey?->last_used_at?->toIso8601String(),
|
||||
@@ -179,4 +183,9 @@ class CreatorDashboardController extends Controller
|
||||
] : null,
|
||||
];
|
||||
}
|
||||
|
||||
private function mediaUrl(?string $path): ?string
|
||||
{
|
||||
return $path ? Storage::url($path) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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