6

As I know to reference a Nova Field you can use the $this object in the Fields Function.

So I have this code, my problem is that these values are empty and should not:

  • $this->origin_coordinates
  • $this->destination_coordinates

Even though my Index Page display the fields origin_coordinates and destination_coordinates with a value.

Do you know why the Measure field is empty which is base on the fields I mentioned.

Thks,

    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')
        ),

ronny torres
  • 131
  • 4

0 Answers0