Voyager editing page slug title exception in translatable

177 Views Asked by At

I am trying to change the slug of a page of my laravel website using voyager, but i get this exception "Invalid Translatable fieldbody"

The function in which the error seems to occur:

public function prepareTranslations(&$request)
    {
        $translations = [];

        // Translatable Fields
        $transFields = $this->getTranslatableAttributes();

        foreach ($transFields as $field) {
            if (!$request->input($field.'_i18n')) {
                throw new Exception('Invalid Translatable field'.$field);
            }

            $trans = json_decode($request->input($field.'_i18n'), true);

            // Set the default local value
            $request->merge([$field => $trans[config('voyager.multilingual.default', 'en')]]);

            $translations[$field] = $this->setAttributeTranslations(
                $field,
                $trans
            );

            // Remove field hidden input
            unset($request[$field.'_i18n']);
        }

        // Remove language selector input
        unset($request['i18n_selector']);

        return $translations;
    }

Also i am not able to edit this this. I already cleared my caches and configuration.

I tried to comment the exception but it did not work as expected on the website.

0

There are 0 best solutions below