PHPackages                             xxc/nova-translatable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xxc/nova-translatable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xxc/nova-translatable
=====================

A Laravel Nova field for spatie/laravel-translatable.

1.0(7y ago)131MITVuePHP &gt;=7.1.0

Since Oct 21Pushed 7y ago2 watchersCompare

[ Source](https://github.com/xxaxxo/nova-translatable)[ Packagist](https://packagist.org/packages/xxc/nova-translatable)[ RSS](/packages/xxc-nova-translatable/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Nova Translatable Field
=======================

[](#nova-translatable-field)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ffa236558f3a3ac2b49db256c55e4eb8de024a94273579f17a6ade51c0b5be03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7878632f6e6f76612d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xxc/nova-translatable)

Adds the ability to show and edit translated fields created with [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) package.

It will show up in the detail view like this:

[![](https://raw.githubusercontent.com/xxaxxo/nova-translatable/master/nova-spatie-translatable-details.png)](https://raw.githubusercontent.com/xxaxxo/nova-translatable/master/nova-spatie-translatable-details.png)

And in the edit view like this:

[![](https://raw.githubusercontent.com/xxaxxo/nova-translatable/master/nova-spatie-translatable-edit.png)](https://raw.githubusercontent.com/xxaxxo/nova-translatable/master/nova-spatie-translatable-edit.png)

Installation and usage
----------------------

[](#installation-and-usage)

You can require this package using composer:

```
composer require xxc/nova-translatable

```

You can add the field follows:

```
use xXc\Translatable\Translatable;

Translatable::make('Description'),

```

Make sure, that you have your Eloquent model setup correct:

- First, you need to add the `Spatie\Translatable\HasTranslations`-trait.
- Next, you should create a public property `$translatable` which holds an array with all the names of attributes you wish to make translatable.
- Finally, you should make sure that all translatable attributes are set to the `text`-datatype in your database. If your database supports `json`-columns, use that.

Here's an example of a prepared model:

```
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;

class NewsItem extends Model
{
    use HasTranslations;

    public $translatable = ['name'];
}
```

### Defining Locales

[](#defining-locales)

Locales can be defined via config file `config/translatable.php` (config file can be created via [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable#installation) package) by adding a `locales` array:

```
// config/translatable.php
return [
    ...
    'locales' => [
        'en' => 'English',
        'de' => 'German',
        'fr' => 'French',
    ],
];

```

Alternatively you can "override" the config locales with the `locales(...)` method:

```
Translatable::make('Description')->locales([
    'en' => 'English',
    'de' => 'German',
]),

```

### Single Line Option

[](#single-line-option)

By default the input field on the edit view is a textarea. If you want to change it to a single line input field you can add the `singleLine()` option:

```
Translatable::make('Description')->locales([...])->singleLine(),

```

### Trix Editor

[](#trix-editor)

You can use the trix editor for your translated fields by using the `trix()` option:

```
Translatable::make('Description')->trix(),

```

### Index View

[](#index-view)

By default the locale used when displaying the field on the index view is determined by `app()->getLocale()`. To override this you can use the `indexLocale($locale)` option:

```
Translatable::make('Description')->indexLocale('de'),

```

### Simultaneous Tab changing

[](#simultaneous-tab-changing)

By default the tabs of the languages change on all displayed fields when you click on one of them

### The readOnly option

[](#the-readonly-option)

Added a readonly option for a field

```
Translatable::make('Description')->readOnly(),
```

### The fieldHookup option

[](#the-fieldhookup-option)

Using fieldHookup() method will trigger the inputted value of one field to be transferred to another. This helps a lot when generating slugs for sef urls. Also - this can be used with a combination with resolveUsing() in order to modify the inputted value of a field

[![](https://raw.githubusercontent.com/xxaxxo/nova-translatable/master/nova-slug-demo.gif)](https://raw.githubusercontent.com/xxaxxo/nova-translatable/master/nova-slug-demo.gif)

### Credits

[](#credits)

[spatie/laravel-translatable](https://github.com/spatie/laravel-translatable)

[mrmonat/nova-translatable](https://github.com/mrmonat/nova-translatable)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2763d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbc9ce9bf4321141561d259bf24ba28ee614592af9a8c4f2cef82cf32f5760ee?d=identicon)[xxaxxo](/maintainers/xxaxxo)

---

Top Contributors

[![xxaxxo](https://avatars.githubusercontent.com/u/1206043?v=4)](https://github.com/xxaxxo "xxaxxo (5 commits)")

---

Tags

laraveltranslatablenova

### Embed Badge

![Health badge](/badges/xxc-nova-translatable/health.svg)

```
[![Health](https://phpackages.com/badges/xxc-nova-translatable/health.svg)](https://phpackages.com/packages/xxc-nova-translatable)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[kongulov/nova-tab-translatable

Making Nova Tab Translatable

8559.5k2](/packages/kongulov-nova-tab-translatable)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17165.2k](/packages/murdercode-nova4-tinymce-editor)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
