locale = $locale; } public function transform(Video $video) { $translatedFile = $video->getTranslations('video',[$this->locale]); $file = $translatedFile ? url(Str::replaceFirst('public/', '', $translatedFile[$this->locale])) : '-'; return [ 'id' => $video->id, 'title' => $video->title, 'image' => url($video->image), 'video' => $file, ]; } }