Created
October 17, 2025 15:24
-
-
Save NandoKstroNet/bad1566fe302e52f26cd97df0ffcdb7b to your computer and use it in GitHub Desktop.
Trait Spatie Sluggable - VideoFlix Code Experts, saiba mais em https://codeexperts.com.br
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Traits; | |
| use Spatie\Sluggable\HasSlug; | |
| use Spatie\Sluggable\SlugOptions; | |
| trait Sluggable | |
| { | |
| use HasSlug; | |
| public function getSlugOptions(): SlugOptions | |
| { | |
| return SlugOptions::create() | |
| ->generateSlugsFrom($this->slugColumnFrom) | |
| ->saveSlugsTo('slug'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment