ron*_*res 7 laravel laravel-nova
据我所知,要引用 Nova 字段,您可以在字段函数中使用 $this 对象。
所以我有这段代码,我的问题是这些值是空的,不应该:
即使我的索引页显示了带有值的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')
),
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2041 次 |
| 最近记录: |