spatie / laravel-tags

Add tags and taggable behaviour to your Laravel app
https://freek.dev/609-an-opinionated-tagging-package-for-laravel-apps
MIT License
1.61k stars 281 forks source link

getPivotModelClassName(): Return value must be of type string, null returned #472

Closed the-dijkstra closed 9 months ago

the-dijkstra commented 1 year ago

Description

I think there is a regression after yesterday release.

Model::getPivotModelClassName(): Return value must be of type string, null returned in /../vendor/spatie/laravel-tags/src/HasTags.php:34
the-dijkstra commented 1 year ago

After further inspection, I found out that #470 has added this to the config file:

        /*
         * The fully qualified class name of the pivot model.
         */
        'class_name' => Illuminate\Database\Eloquent\Relations\MorphPivot::class,

but it was not documented in the change-log, so for any one who published the package config they should add it manually.

neatpro commented 1 year ago

Good catch @the-dijkstra,

Just to add, it needs to be added to taggable array:

'taggable' => [
    'table_name' => 'taggables',
    'morph_name' => 'taggable',

    /*
    * The fully qualified class name of the pivot model.
    */
    'class_name' => Illuminate\Database\Eloquent\Relations\MorphPivot::class,
]
spatie-bot commented 9 months ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.