forked from eatvio/eatvio-infra
make static analyz for blogPost
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\BlogPostComment
|
||||
@@ -39,12 +40,12 @@ class BlogPostComment extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function author()
|
||||
public function author(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function blog_post()
|
||||
public function blog_post(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(BlogPost::class, 'blog_post_id');
|
||||
}
|
||||
@@ -54,7 +55,7 @@ class BlogPostComment extends Model
|
||||
return $this->hasMany(BlogPostCommentUpvote::class, 'blog_post_comment_id');
|
||||
}
|
||||
|
||||
public function isUpVoted(): bool
|
||||
public function isUpVoted(): bool|int
|
||||
{
|
||||
$curUser = auth()->user();
|
||||
if ($curUser) {
|
||||
@@ -67,7 +68,7 @@ class BlogPostComment extends Model
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isDownVoted(): bool
|
||||
public function isDownVoted(): bool|int
|
||||
{
|
||||
$curUser = auth()->user();
|
||||
if ($curUser) {
|
||||
|
||||
Reference in New Issue
Block a user