the browser-facing portion of osu!
at master 918 B view raw
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\Libraries\ModdingHistoryEventsBundle; 9 10class BeatmapsetEventsController extends Controller 11{ 12 public function __construct() 13 { 14 $this->middleware('require-scopes:public', ['only' => ['index']]); 15 16 parent::__construct(); 17 } 18 19 public function index() 20 { 21 $bundle = ModdingHistoryEventsBundle::forListing(null, request()->all()); 22 $jsonChunks = $bundle->toArray(); 23 $paginator = $bundle->getPaginator(); 24 $params = $bundle->getParams(); 25 26 if (is_api_request()) { 27 return $jsonChunks; 28 } else { 29 return ext_view('beatmapset_events.index', compact('paginator', 'params', 'jsonChunks')); 30 } 31 } 32}