public function update(Page $page, array $data)
    {
        if (Session::has('multi_language_enabled')) {
            $languageId = $data['language_id'];
            $languaModel = Language::find($languageId);
            
            if ($languaModel->is_default) {
                return $page->update($data);
            } else {
                
                $translatedModel = $page
                    ->translations()
                    ->whereLanguageId($languageId)
                    ->first();
                if (null === $translatedModel) {
                    return PageTranslation::create(
                        array_merge($data, ['page_id' => $page->id])
                    );
                } else {
                    $translatedModel->update(
                        $data,
                        $page->getTranslatedAttributes()
                    );

                    return $translatedModel;
                }

            }
        } else {
            return $page->update($data);
        }
    }