Level 6
i solved it like this:
public function title()
{
if ($this->field_bool == 1)
return '(OK) '.$this->{static::$title};
else return $this->{static::$title};
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I would like to modify this function in order to replace the word "Details" with a boolean field of the DB.
I mean I have a model called: Poll
I mean I have a Resource called: ResourcePoll
When I click on the detail I am in the title:
Poll Details : 1
and I would like to replace it with
Poll <id field 1> : 1
I know this is the function that concerns him:
public static function singularLabel()
{
return Str::singular(static::label());
}
in name_app/nova/src/resource
I just have no idea how to take id and replace Details
i solved it like this:
public function title()
{
if ($this->field_bool == 1)
return '(OK) '.$this->{static::$title};
else return $this->{static::$title};
}
Please or to participate in this conversation.