*/ protected $casts = [ 'id' => 'integer', 'active' => 'boolean', 'force_pass_reset' => 'boolean', 'podcast_id' => '?integer', 'podcast_role' => '?string', ]; /** * Returns the podcasts the user is contributing to * * @return Podcast[] */ public function getPodcasts(): array { if ($this->id === null) { throw new RuntimeException('Users must be created before getting podcasts.',); } if ($this->podcasts === null) { $this->podcasts = (new PodcastModel())->getUserPodcasts($this->id); } return $this->podcasts; } }