*/ public function toArray(Request $request): array { return [ 'identifiant' => $this->identifiant, 'titre' => $this->titre, 'contenu_markdown' => $this->when($request->routeIs('api.v1.cours.show'), $this->contenu_markdown), ]; } }