improve import / export flow and clean up relationships
This commit is contained in:
hackerESQ
2024-08-28 22:06:47 -05:00
parent e684c1f4a3
commit 69c43dc41f
15 changed files with 104 additions and 74 deletions
+7
View File
@@ -62,6 +62,13 @@ class Portfolio extends Model
return $this->hasMany(DailyChange::class);
}
public function scopeMyPortfolios()
{
return $this->whereHas('users', function ($query) {
$query->where('user_id', auth()->user()->id);
});
}
public function scopeWithoutWishlists()
{
return $this->where(['wishlist' => false]);