static analizys update

This commit is contained in:
Anatoliy Poloz
2024-01-15 15:10:57 +03:00
parent 30e4c21a47
commit 09a8900690
69 changed files with 638 additions and 575 deletions

View File

@@ -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;