fix:scope chat history for each user
This commit is contained in:
@@ -139,7 +139,7 @@ class Holding extends Model
|
|||||||
*/
|
*/
|
||||||
public function chats()
|
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)
|
public function scopeWithMarketData($query)
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class Portfolio extends Model
|
|||||||
*/
|
*/
|
||||||
public function chats()
|
public function chats()
|
||||||
{
|
{
|
||||||
return $this->morphMany(AiChat::class, 'chatable');
|
return $this->morphMany(AiChat::class, 'chatable')->where('user_id', auth()->user()->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeMyPortfolios()
|
public function scopeMyPortfolios()
|
||||||
|
|||||||
Reference in New Issue
Block a user