Как я знаю, для ссылки на поле Nova вы можете использовать объект $ this в функции Fields.
Итак, у меня есть этот код, моя проблема в том, что эти значения пусты и не должны:
- $ this-> origin_coordinates
- $ this-> destination_coordinates
Даже если на моей странице индекса отображаются поля origin_coordinates и destination_coordinates со значением.
Знаете ли вы, почему поле «Мера» пусто, основанное на полях, которые я упомянул.
Спасибо,
BelongsTo::make('Warehouse')
->withoutTrashed()
->rules('required')
->sortable(),
BelongsTo::make('Customer')
->withoutTrashed()
->rules('required')
->sortable(),
BelongsToDependency::make('Consignee')
->dependsOn('customer', 'customer_id'),
Text::make('origin_coordinates', function() {
return $this->warehouse->longitude . ','. $this->warehouse->latitude;
}),
Text::make('destination_coordinates', function() {
return $this->consignee->longitude . ',' . $this->consignee->latitude;
}),
RouteMeasures::make('Measures') <---- Here is my problems this value is empty and should not
->route(
$this->origin_coordinates,
$this->destination_coordinates,
env('MAPBOX_ACCESS_TOKEN')
),