forked from eatvio/eatvio-infra
make code style phpinsight
This commit is contained in:
@@ -4,14 +4,13 @@ namespace App\Models;
|
||||
|
||||
use CyrildeWit\EloquentViewable\Contracts\Viewable;
|
||||
use CyrildeWit\EloquentViewable\InteractsWithViews;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* App\Models\BlogPost
|
||||
@@ -60,13 +59,13 @@ class BlogPost extends Model implements Viewable
|
||||
use HasFactory, InteractsWithViews;
|
||||
|
||||
// protected array $withCount = [
|
||||
// 'likes',
|
||||
// 'comments',
|
||||
// 'likes',
|
||||
// 'comments',
|
||||
// ];
|
||||
|
||||
public static function getWithLikesAndCommentsCount(): Builder
|
||||
{
|
||||
return self::withCount(['likes', 'comments']);
|
||||
return self::withCount(['likes', 'comments']);
|
||||
}
|
||||
|
||||
public function tags(): MorphToMany
|
||||
|
||||
Reference in New Issue
Block a user