diff --git a/app/Models/Holding.php b/app/Models/Holding.php index bd35f9a..b8c7d87 100644 --- a/app/Models/Holding.php +++ b/app/Models/Holding.php @@ -139,7 +139,7 @@ class Holding extends Model */ public function chats() { - return $this->morphMany(AiChat::class, 'chatable'); + return $this->morphMany(AiChat::class, 'chatable')->where('user_id', auth()->user()->id); } public function scopeWithMarketData($query) diff --git a/app/Models/Portfolio.php b/app/Models/Portfolio.php index 6e7f167..0660745 100644 --- a/app/Models/Portfolio.php +++ b/app/Models/Portfolio.php @@ -72,7 +72,7 @@ class Portfolio extends Model */ public function chats() { - return $this->morphMany(AiChat::class, 'chatable'); + return $this->morphMany(AiChat::class, 'chatable')->where('user_id', auth()->user()->id); } public function scopeMyPortfolios()