forked from eatvio/eatvio-infra
04 10 2023 snapshot
This commit is contained in:
@@ -14,6 +14,7 @@ class Diet extends Model implements Viewable
|
||||
{
|
||||
use HasFactory, InteractsWithViews;
|
||||
|
||||
|
||||
protected $withCount = [
|
||||
'likes',
|
||||
'comments',
|
||||
@@ -29,7 +30,15 @@ class Diet extends Model implements Viewable
|
||||
|
||||
public function author()
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'diet_author', 'diet_id', 'user_id');
|
||||
return $this
|
||||
->belongsToMany(User::class, 'diet_author', 'diet_id', 'user_id');
|
||||
/*->withDefault(
|
||||
[
|
||||
'name' => 'Guest Author',
|
||||
'id' => 0,
|
||||
'profile_photo_url' => 'https://dev2.eatvio.com/storage/profile-photos/mW87tqy9P8O31Dauyvg8f7GowMNMsgt9J6u47T7S.jpg'
|
||||
]
|
||||
);*/
|
||||
}
|
||||
|
||||
public function comments()
|
||||
|
||||
Reference in New Issue
Block a user