Merge pull request #4 from investbrainapp/dev

fix:scope chat history for each user
This commit is contained in:
hackerESQ
2024-11-03 08:49:42 -06:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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()