1 | <?php |
||
12 | class Translation extends Field |
||
13 | { |
||
14 | /** |
||
15 | * The field's component. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | public $component = 'nova-translation-field'; |
||
20 | |||
21 | public function __construct($name, $attribute = null, callable $resolveCallback = null) |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function resolve($resource, $attribute = null) |
||
44 | |||
45 | /** |
||
46 | * Return all indexed locales. |
||
47 | * |
||
48 | * @return array |
||
49 | * @throws \Exception |
||
50 | */ |
||
51 | protected function locales() |
||
57 | |||
58 | /** |
||
59 | * Return translations entries for given translatable model. |
||
60 | * |
||
61 | * @param \BBSLab\NovaTranslation\Models\Contracts\IsTranslatable $resource |
||
62 | * @return array |
||
63 | */ |
||
64 | protected function translations(IsTranslatable $resource) |
||
72 | } |
||
73 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: