Declaration of App\Models\Post::sluggable() must be compatible with Cviebrock\EloquentSluggable\Sluggable

Created at 23-Feb-2022 , By samar

Declaration of AppModelsPost::sluggable() must be compatible with CviebrockEloquentSluggableSluggable

We’ll attempt to use programming in this lesson to solve the "Declaration of AppModelsPost::sluggable() must be compatible with CviebrockEloquentSluggableSluggable" puzzle.

You have to add : array with sluggable() to remove error Declaration of App\Models\Post::sluggable() must be compatible with Cviebrock\EloquentSluggable\Sluggable::sluggable(): array
  • Add : array to sluggable()

    --PATH app\Models\Post.php
    public function sluggable(): array
    {
        return [
            'slug' => [
                'source' => 'title'
            ],
        ];
    }
    

Back to code snippet queries related laravel

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.