diff --git a/tests/Etc/Comment.php b/tests/Etc/Comment.php index 27284e2f..691e82e0 100644 --- a/tests/Etc/Comment.php +++ b/tests/Etc/Comment.php @@ -3,6 +3,7 @@ namespace Stancl\Tenancy\Tests\Etc; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; class Comment extends Model { @@ -10,7 +11,7 @@ class Comment extends Model public $timestamps = false; - public function post() + public function post(): BelongsTo { return $this->belongsTo(Post::class); } diff --git a/tests/Etc/Post.php b/tests/Etc/Post.php index 94c70fbf..d73ed731 100644 --- a/tests/Etc/Post.php +++ b/tests/Etc/Post.php @@ -3,8 +3,12 @@ namespace Stancl\Tenancy\Tests\Etc; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasMany; use Stancl\Tenancy\Database\Concerns\BelongsToTenant; +/** + * This model is intended to be used with the single-database tenancy approach. + */ class Post extends Model { use BelongsToTenant; @@ -13,12 +17,12 @@ class Post extends Model public $timestamps = false; - public function comments() + public function comments(): HasMany { return $this->hasMany(Comment::class); } - public function scoped_comments() + public function scoped_comments(): HasMany { return $this->hasMany(Comment::class); } diff --git a/tests/Etc/ScopedComment.php b/tests/Etc/ScopedComment.php index 733d1ea9..90b4f4dd 100644 --- a/tests/Etc/ScopedComment.php +++ b/tests/Etc/ScopedComment.php @@ -4,6 +4,9 @@ namespace Stancl\Tenancy\Tests\Etc; use Stancl\Tenancy\Database\Concerns\BelongsToPrimaryModel; +/** + * This model is intended to be used with the single-database tenancy approach. + */ class ScopedComment extends Comment { use BelongsToPrimaryModel;