diff --git a/config/like.php b/config/like.php index 0883ad1..8dc6e2f 100644 --- a/config/like.php +++ b/config/like.php @@ -1,16 +1,16 @@ 'Like', + 'name' => 'The interactions configuration', /* - * The flag to determine if the likes table should use UUIDs. - * If you want to use UUIDs instead of auto-incrementing integers for your likes table, set this to true. + * The flag to determine if the interactions table should use UUIDs. + * If you want to use UUIDs instead of auto-incrementing integers for your interactions table, set this to true. */ 'is_uuids' => false, /* - * The table name for likes records. + * The table name for interaction records. */ 'table_name' => 'likes', diff --git a/src/Models/Like.php b/src/Models/Like.php index 7bc014f..f1252c2 100644 --- a/src/Models/Like.php +++ b/src/Models/Like.php @@ -89,14 +89,14 @@ public function isLove(): bool * Scope a query to only include records of a given model type. * * @param Builder $query - * @param string $modelType + * @param string $modelType The model type. E.g. App\Models\Post::class * * @return Builder */ public function scopeWithModelType(Builder $query, string $modelType): Builder { // Use with likes() relationship. Can't use with likeOne() relationship. - return $query->where('model_type', app($modelType)->getMorphClass()); + return $query->where('model_type', $modelType); } /** diff --git a/src/Traits/InteractionRelationship.php b/src/Traits/InteractionRelationship.php index 389c923..13aaafc 100644 --- a/src/Traits/InteractionRelationship.php +++ b/src/Traits/InteractionRelationship.php @@ -19,7 +19,7 @@ trait InteractionRelationship { /** - * Like has one relationship with the model. + * Interaction has one relationship with the model. * * @return MorphOne */ @@ -29,7 +29,7 @@ public function likeOne(): MorphOne } /** - * Like has many relationship with the model. + * Interaction has many relationship with the model. * * @return MorphMany */