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\Spotlight;
9
10/**
11 * @group Ranking
12 */
13class SpotlightsController extends Controller
14{
15 public function __construct()
16 {
17 parent::__construct();
18
19 $this->middleware('require-scopes:public');
20 }
21
22 /**
23 * Get Spotlights
24 *
25 * Gets the list of spotlights.
26 *
27 * ---
28 *
29 * ### Response Format
30 *
31 * Returns [Spotlights](#spotlights)
32 */
33 public function index()
34 {
35 return [
36 'spotlights' => json_collection(Spotlight::orderBy('chart_id', 'desc')->get(), 'Spotlight'),
37 ];
38 }
39}