the browser-facing portion of osu!
at master 31 lines 758 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\Transformers; 7 8use App\Models\Beatmapset; 9 10class BeatmapsetDescriptionTransformer extends TransformerAbstract 11{ 12 protected array $defaultIncludes = [ 13 'bbcode', 14 ]; 15 16 protected $permissions = [ 17 'bbcode' => 'BeatmapsetDescriptionEdit', 18 ]; 19 20 public function transform(Beatmapset $beatmapset) 21 { 22 return [ 23 'description' => $beatmapset->description(), 24 ]; 25 } 26 27 public function includeBbcode(Beatmapset $beatmapset) 28 { 29 return $this->primitive($beatmapset->editableDescription()); 30 } 31}