Skip to content

Commit

Permalink
Improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Jul 12, 2024
1 parent a70506c commit edcce8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Models/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function commentsFromRelationsWithTrashedIntermediateDeepModel(): HasMany
public function commentsFromRelationsWithTrashedIntermediateRelatedModel(): HasManyDeep
{
return $this->hasManyDeepFromRelationsWithConstraints(
[[$this, 'usersWithTrashed'], [new User(), 'comments']]
[[$this, 'usersWithTrashed'], [new User(), 'comment']]
);
}

Expand Down
6 changes: 6 additions & 0 deletions tests/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
use Illuminate\Database\Eloquent\SoftDeletes;
use Staudenmeir\EloquentHasManyDeep\HasManyDeep;

class User extends Model
{
use SoftDeletes;

public function comment(): HasOneThrough
{
return $this->hasOneThrough(Comment::class, Post::class);
}

public function comments(): HasManyThrough
{
return $this->hasManyThrough(Comment::class, Post::class);
Expand Down

0 comments on commit edcce8d

Please sign in to comment.