1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6namespace App\Http\Controllers;
7
8use App\Models\LivestreamCollection;
9use Request;
10
11class LivestreamsController extends Controller
12{
13 public function index()
14 {
15 $livestream = new LivestreamCollection();
16 $streams = $livestream->all();
17 $featuredStream = $livestream->featured();
18
19 return ext_view('livestreams.index', compact('streams', 'featuredStream'));
20 }
21
22 public function promote()
23 {
24 priv_check('LivestreamPromote')->ensureCan();
25
26 LivestreamCollection::promote(Request::input('id'));
27
28 return ext_view('layout.ujs-reload', [], 'js');
29 }
30}