laravel / nova-issues

554 stars 34 forks source link

Slug Field not updating on Update #4753

Closed schonhoff closed 2 years ago

schonhoff commented 2 years ago

Description:

Hello,

if we update a resource with a field (title) and a slug field (title_slug) connected to the field (title), updating the field doesn't update the slug field. I would expect this behavior because it updates on key-up on creating an entry.

Detailed steps to reproduce the issue on a fresh Nova installation:

1.) Make a model (Blog) with 2 fields (title and title_slug) 2.) Make a Nova resource (Blog) for that model with a Text field (title) and a Slug field (title_slug)

//  public function fields(NovaRequest $request)
[...]
Text::make(__('Title'), 'title')
  ->rules('required', 'max:255', 'string'),

Slug::make(__('Title slug'), 'title_slug')
  ->from('title'),
[...]

3.) Switch to the Nova backend and create an entry on the Blog resource 4.) Update the fresh created blog entry and update the title field

expected behavior: The slug field will change as well

current behavior: The Slug field will not change.

Another topic with the slug field: If I may ask a question? Is it possible to add German Umlauts Slug support? ä => ae; ö => oe; ü =>; ß => ss ? Would be very nice! I can open a discussion or another issue if necessary. :-)

crynobone commented 2 years ago

The ecisting behaviour are expected and coded as such at the moment. slug such as URL once created is considered a unique and should require manual editing if needed.