public function destroy($id) { $cover = TopicCover::find($id); if ($cover !== null) { priv_check('ForumTopicCoverEdit', $cover)->ensureCan(); $cover->deleteWithFile(); } return json_item($cover, new TopicCoverTransformer()); }