How do you integrate Laravel Tags with laravel-sluggable? #516
Unanswered
Rocketpilot
asked this question in
Q&A
Replies: 1 comment
-
Just create an custom <?php
namespace App\Models;
use Spatie\Tags\Tag as BaseTag;
class Tag extends BaseTag
{
/**
* Get the route key for the model.
*/
public function getRouteKeyName(): string
{
return 'slug';
}
} Finally change the All code is untested :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been having trouble getting routing via slug working with Laravel Tags. I haven't created a custom model, which would probably work, but the docs don't give a complete example and I'm not an advanced enough developer to fill in the missing pieces.
I see there's a config setting for choosing which slugger to use, but again the documentation stops before it spells out how to do it.
Great package, when it works, it works flawlessly but there are edge cases that really stick out.
Beta Was this translation helpful? Give feedback.
All reactions