Level 41
Don't know Nova specifically BUT you might want to implement the following method in the Gearratio
public function __toString()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
This stopped working after i changed the datatype to integer in my database. Why is that?
BelongsTo::make('Radio', 'gearratio', 'App\Nova\Gearratio')
->displayUsing(function ($name) {
return 'i: '.$name;
}),
Getting this error:
Object of class App\Nova\Gearratio could not be converted to string
Or simply tell it what to actually show
BelongsTo::make('Radio', 'gearratio', 'App\Nova\Gearratio')
->displayUsing(function ($name) {
return 'i: '.$name->my_column;
}),
Please or to participate in this conversation.