forked from eatvio/eatvio-infra
static analizys update
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
@@ -39,12 +40,12 @@ class DietComment extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function author()
|
||||
public function author(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function diet()
|
||||
public function diet(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Diet::class, 'diet_id');
|
||||
}
|
||||
@@ -61,7 +62,7 @@ class DietComment extends Model
|
||||
->user()
|
||||
->diet_comment_upvotes()
|
||||
->forDietCommentsUpVote($this)
|
||||
->count();
|
||||
->count() > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -74,7 +75,7 @@ class DietComment extends Model
|
||||
->user()
|
||||
->diet_comment_upvotes()
|
||||
->forDietCommentsDownVote($this)
|
||||
->count();
|
||||
->count() > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user