nova-slug-field icon indicating copy to clipboard operation
nova-slug-field copied to clipboard

Nova 4.0

Open gsusanj opened this issue 2 years ago • 11 comments

Hey, any chance to update this package to Nova 4.0? The issue is the TextWithSlug field does not show up on any screen.

gsusanj avatar Jun 02 '22 11:06 gsusanj

Hi There, any update on this?

samdharris avatar Jul 05 '22 09:07 samdharris

In the meanwhile you could use the new native depensOn to create a replacement for the functionality of this package:

Text::make(__('Name'), 'name'),

Text::make(__('Slug'), 'slug')
    ->dependsOn(
        ['name'],
        function(Text $field, NovaRequest $request, FormData $formData) {
            if ($formData->name <> optional($request->resource()::find($request->resourceId))->name) {
                $field->value = Str::slug($formData->name);
                $field->help(config('app.url') . '/categories/' . $field->value);
            }
        }
    ),

sanderbaas avatar Aug 09 '22 13:08 sanderbaas

Hi all!

I don't have a nova 4 license yet, so am not able to test it. If anyone wants to provide a PR, you are very welcome to.

Thank you very much and have a great day!

tomhatzer avatar Nov 25 '22 09:11 tomhatzer

+1

jmverges avatar Feb 06 '23 07:02 jmverges

@sanderbaas That example doesn't work as I would expect NovaSlugField works but thanks for the snippet @tomhatzer did you get a license?

jmverges avatar Feb 06 '23 10:02 jmverges

@tomhatzer I just openend a PR that works well.

jmverges avatar Feb 07 '23 14:02 jmverges

I think this functionality is now part of Nova 4: https://nova.laravel.com/docs/4.0/resources/fields.html#slug-field

GingerNinjaNicko avatar Mar 20 '23 12:03 GingerNinjaNicko

@tomhatzer any update on that PR? 🤔

juergenZeindlinger avatar Dec 27 '23 13:12 juergenZeindlinger

@juergenZeindlinger if you can test it and can confirm that it works I‘m willing to approve and merge it :) I don‘t work with Nova anymore and don‘t have a license for v4.

tomhatzer avatar Dec 27 '23 20:12 tomhatzer

@tomhatzer I can't but @jmverges mentioned that his PR works well 🤔 Don't know

juergenZeindlinger avatar Dec 28 '23 09:12 juergenZeindlinger

I think this functionality is now part of Nova 4: https://nova.laravel.com/docs/4.0/resources/fields.html#slug-field

Thanks for that, yep Nova 4 supports 95% of the functionality of this package out of the box. The only differences I can see are that disableAutoUpdateWhenUpdating is enabled by default, with no way to turn it off (I prefer it enabled anyways). And the slug generation is debounced and not as responsive, but I can live with that.

Anyways thank you to the maintainers of this package for providing it for Nova 3 for many years 🙏🏼

andrewtweber avatar Jan 17 '24 05:01 andrewtweber