arsenaltech / nova-tab

Laravel Nova Tabs
74 stars 17 forks source link

Add title to ressource edit #17

Open bernhardh opened 6 years ago

bernhardh commented 6 years ago

The default title of a ressource edit view is "Edit RESSOURCE_NAME". So if you would edit an artikel you see "Edit Article", but you don't know, which article you are currently editing. Normally you would have a field like Text::make("name") or Text::make("title") to identify your article. But if you are using tabs, you see this "name"-field only in one tab. Let me illustrate it by an example:

I have 5 tabs. If you are on the first one, you see the "Name" Field and know which article you are currently editing:

image

But if you switch to another tab, you can't see the name of the article anymore:

image

Is there maybe a way, to add the name of the ressource somewhere, where it is visible every time, somehow like so:

image

shabbirbharmal commented 6 years ago

This should be possible by overriding label method in your resource class.

bernhardh commented 6 years ago

I don't think this is possible - how should that work? The public static function label is a static method. So you don't have access to the model data itself, so no access to the model name/title field.