forked from eatvio/eatvio-infra
static analizys update
This commit is contained in:
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
/**
|
||||
* App\Models\DietCommentUpvote
|
||||
@@ -42,22 +44,22 @@ class DietCommentUpvote extends Model
|
||||
'type',
|
||||
];
|
||||
|
||||
public function author()
|
||||
public function author(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function diet_comment()
|
||||
public function diet_comment(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DietComment::class, 'comment_id');
|
||||
}
|
||||
|
||||
public function scopeForDietCommentsUpVote($query, DietComment $comment)
|
||||
public function scopeForDietCommentsUpVote(Builder $query, DietComment $comment): Builder
|
||||
{
|
||||
return $query->where('comment_id', $comment->id)->where('type', 'upvote');
|
||||
}
|
||||
|
||||
public function scopeForDietCommentsDownVote($query, DietComment $comment)
|
||||
public function scopeForDietCommentsDownVote(Builder $query, DietComment $comment): Builder
|
||||
{
|
||||
return $query->where('comment_id', $comment->id)->where('type', 'downvote');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user