where('in_ott', true); }); } public function ottData() { $locale = 'en'; if (session()->has('frontend_locale')) { $locale = session()->get('frontend_locale'); } return $this->hasOne(OTTData::class, 'studio_plus_video_id', 'id')->where('locale', $locale); } public function getOttTitleAttribute() { if (!empty($this->ottData)) { return $this->ottData->title; } return $this->product_name; } public function getOttDescriptionAttribute() { if (!empty($this->ottData)) { return $this->ottData->description; } return ''; } public function getOttLinksAttribute() { if (!empty($this->ottData)) { return $this->ottData->links; } return []; } public function getCreatorAttribute() { if ($this->channel) { return Creator::find($this->channel->user_id); } } public function getVideoUrlAttribute($value) { $bucketName = Config::get('studioplus.bucket_name'); $value = Str::remove('wticreatorhub/', $value); return Config::get('studioplus.google_api_endpoint') . "/$bucketName/$value"; } }