Admin can now control channel creation from the admin dashboard

This commit is contained in:
2026-05-16 03:43:25 +03:30
parent 34445f3032
commit f46f32aa4c
14 changed files with 639 additions and 95 deletions

View File

@@ -25,6 +25,7 @@ class CreatorDashboardController extends Controller
return Inertia::render('dashboard', [
'channel' => $channel ? $this->channelPayload($channel) : null,
'canCreateChannel' => $request->user()->canCreateChannel(),
'plainStreamKey' => session('plain_stream_key'),
'streaming' => [
'ingestServer' => $streamKeys->ingestServer(),
@@ -57,6 +58,7 @@ class CreatorDashboardController extends Controller
public function storeChannel(Request $request, StreamKeyManager $streamKeys): RedirectResponse
{
abort_if($request->user()->channel()->exists(), 422, 'This account already owns a channel.');
abort_unless($request->user()->canCreateChannel(), 403, 'An admin must enable channel creation for this account.');
$validated = $request->validate([
'display_name' => ['required', 'string', 'max:80'],