Skip to main content

Slug from Name with Auto-Complete

Premium
2:02

The Full Lesson is Only for Premium Members

Want to access all of our courses? (31 h 16 min)

You also get:

55 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

KB
Kurt Bauman ✓ Link copied!

I know that this tutorial is for Filament V2. I also tried the updated version on the FilamentPHP site for V3 with the same issue. When typing the data for the 'name' field, the same as the tutorial here, the charactors entered change while typing. If I were to type 'Main Street' three times, all three end up with various typos. Back spacing also seems to do really odd things, This problem is also present in the Edit form. Am I missing something, or is there a known issue? Thank you.

M
Modestas ✓ Link copied!

You should probably add onBlur: true to your ->live() field, as changing the slug real-time is... well, challenging:

https://filamentphp.com/docs/3.x/forms/advanced#reactive-fields-on-blur

Also, we do not recommend you to update the SLUG at the edit form as this will change how your SEO works and the post would lose all traction it got due to URL change. It's better to disable this behaviour on the edit form overall and leave the slug field usable only in create

KB
Kurt Bauman ✓ Link copied!

This worked perfectlly.

Thank you for your assistance.