How do I set a slug validator?

You can control if a collection of slugs is valid or not by setting your own validator:

\Aero\Store\Routing\Slugs::setValidator(function ($slugs, $resolver) {
    if ($resolver !== 'listings') return true;

    if ($slugs->count() < 3 && $slugs->where('model_type', 'tag')->count()) return false;

    return true;
});

 


Revision #1
Created 2026-09-24 07:15:07 UTC by Ethan Payne
Updated 2026-09-24 07:15:31 UTC by Ethan Payne