diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 367e177..d7f0162 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -16,7 +16,7 @@ class DashboardController extends Controller $user = $request->user()->load('portfolios'); // get portfolio metrics - $metrics = cache()->remember( + $metrics = cache()->tags(['metrics', 'dashboard', $user->id])->remember( 'dashboard-metrics-' . $user->id, 10, function () { diff --git a/app/Http/Controllers/PortfolioController.php b/app/Http/Controllers/PortfolioController.php index aeeb9a3..368625a 100644 --- a/app/Http/Controllers/PortfolioController.php +++ b/app/Http/Controllers/PortfolioController.php @@ -24,7 +24,7 @@ class PortfolioController extends Controller { // get portfolio metrics - $metrics = cache()->remember( + $metrics = cache()->tags(['metrics', 'portfolio', auth()->user()->id, $portfolio->id])->remember( 'portfolio-metrics-' . $portfolio->id, 60, function () use ($portfolio) { diff --git a/app/Models/Holding.php b/app/Models/Holding.php index 9e4b378..bc7b3a0 100644 --- a/app/Models/Holding.php +++ b/app/Models/Holding.php @@ -125,10 +125,10 @@ class Holding extends Model return $query->where('symbol', $symbol); } - public function refreshDividends() - { - return Dividend::getDividendData($this->attributes['symbol']); - } + // public function refreshDividends() + // { + // return Dividend::getDividendData($this->attributes['symbol']); + // } } \ No newline at end of file diff --git a/app/Models/MarketData.php b/app/Models/MarketData.php index 1530618..cada5f0 100644 --- a/app/Models/MarketData.php +++ b/app/Models/MarketData.php @@ -44,21 +44,25 @@ class MarketData extends Model public static function getMarketData($symbol) { - $market_data = self::firstOrNew(['symbol' => $symbol]); + $market_data = self::firstOrNew([ + 'symbol' => $symbol + ]); // check if new or stale if (!$market_data->exists || now()->diffInMinutes($market_data->updated_at) >= config('market_data.refresh')) { // get quote - $quote = app(MarketDataInterface::class)->quote($symbol); + // $quote = app(MarketDataInterface::class)->quote($symbol); // fill data - $market_data->fill($quote->toArray()); + // $market_data->fill($quote->toArray()); - // save with timestamps updated - $market_data->touch(); + } + // save with timestamps updated + $market_data->touch(); + return $market_data; } diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 4265625..70a05dd 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -45,14 +45,14 @@ class Transaction extends Model $transaction->syncHolding(); - cache()->forget('portfolio-metrics-' . $transaction->portfolio_id); + cache()->tags(['metrics', auth()->user()->id])->flush(); }); static::deleted(function ($transaction) { $transaction->syncHolding(); - cache()->forget('portfolio-metrics-' . $transaction->portfolio_id); + cache()->tags(['metrics', auth()->user()->id])->flush(); }); } @@ -108,15 +108,15 @@ class Transaction extends Model return MarketData::getMarketData($this->attributes['symbol']); } - public function syncDividendsToHolding() - { - return Dividend::syncHoldings(['symbol' => $this->attributes['symbol']]); - } + // public function syncDividendsToHolding() + // { + // return Dividend::syncHoldings(['symbol' => $this->attributes['symbol']]); + // } - public function refreshDividends() - { - return Dividend::getDividendData($this->attributes['symbol']); - } + // public function refreshDividends() + // { + // return Dividend::getDividendData($this->attributes['symbol']); + // } /** * Writes average cost basis to a sale transaction @@ -181,9 +181,9 @@ class Transaction extends Model $holding->save(); // load market data while we're here - // $this->refreshMarketData(); + $this->refreshMarketData(); - // sync dividends to holding + // // sync dividends to holding // $this->syncDividendsToHolding(); } } \ No newline at end of file diff --git a/resources/views/auth/confirm-password.blade.php b/resources/views/auth/confirm-password.blade.php index 1177cb7..b2d0ef7 100644 --- a/resources/views/auth/confirm-password.blade.php +++ b/resources/views/auth/confirm-password.blade.php @@ -1,7 +1,9 @@ - +
+ +
@@ -18,7 +20,7 @@
- + {{ __('Confirm') }}
diff --git a/resources/views/auth/forgot-password.blade.php b/resources/views/auth/forgot-password.blade.php index 9f2d186..f540efe 100644 --- a/resources/views/auth/forgot-password.blade.php +++ b/resources/views/auth/forgot-password.blade.php @@ -1,7 +1,9 @@ - +
+ +
@@ -25,7 +27,7 @@
- + {{ __('Email Password Reset Link') }}
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 02b2aaf..591c488 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,7 +1,9 @@ - +
+ +
@@ -39,7 +41,7 @@ @endif - + {{ __('Log in') }} diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 3a744e9..784d265 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -1,7 +1,9 @@ - +
+ +
@@ -37,8 +39,8 @@
{!! __('I agree to the :terms_of_service and :privacy_policy', [ - 'terms_of_service' => ''.__('Terms of Service').'', - 'privacy_policy' => ''.__('Privacy Policy').'', + 'terms_of_service' => ''.__('Terms of Service').'', + 'privacy_policy' => ''.__('Privacy Policy').'', ]) !!}
@@ -51,7 +53,7 @@ {{ __('Already registered?') }} - + {{ __('Register') }} diff --git a/resources/views/auth/reset-password.blade.php b/resources/views/auth/reset-password.blade.php index cd39caf..f36a637 100644 --- a/resources/views/auth/reset-password.blade.php +++ b/resources/views/auth/reset-password.blade.php @@ -1,7 +1,9 @@ - +
+ +
@@ -27,7 +29,7 @@
- + {{ __('Reset Password') }}
diff --git a/resources/views/auth/two-factor-challenge.blade.php b/resources/views/auth/two-factor-challenge.blade.php index c494863..72b4b97 100644 --- a/resources/views/auth/two-factor-challenge.blade.php +++ b/resources/views/auth/two-factor-challenge.blade.php @@ -1,7 +1,9 @@ - +
+ +
@@ -48,7 +50,7 @@ {{ __('Use an authentication code') }} - + {{ __('Log in') }}
diff --git a/resources/views/auth/verify-email.blade.php b/resources/views/auth/verify-email.blade.php index 1ef5cf6..f14579b 100644 --- a/resources/views/auth/verify-email.blade.php +++ b/resources/views/auth/verify-email.blade.php @@ -1,7 +1,9 @@ - +
+ +
@@ -19,7 +21,7 @@ @csrf
- + {{ __('Resend Verification Email') }}
diff --git a/resources/views/components/application-logo.blade.php b/resources/views/components/application-logo.blade.php index c020524..4c1800d 100644 --- a/resources/views/components/application-logo.blade.php +++ b/resources/views/components/application-logo.blade.php @@ -1,19 +1,15 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + Investbrain \ No newline at end of file diff --git a/resources/views/components/auth-logo.blade.php b/resources/views/components/auth-logo.blade.php deleted file mode 100644 index 6d2fbad..0000000 --- a/resources/views/components/auth-logo.blade.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/resources/views/components/partials/nav-bar.blade.php b/resources/views/components/partials/nav-bar.blade.php index a07a2b7..c4ffffe 100644 --- a/resources/views/components/partials/nav-bar.blade.php +++ b/resources/views/components/partials/nav-bar.blade.php @@ -1,13 +1,13 @@
-
+
- +
diff --git a/resources/views/components/partials/side-bar.blade.php b/resources/views/components/partials/side-bar.blade.php index 7a56bf8..4973bf1 100644 --- a/resources/views/components/partials/side-bar.blade.php +++ b/resources/views/components/partials/side-bar.blade.php @@ -24,13 +24,13 @@
- + @php $user = auth()->user(); @endphp - + @@ -40,7 +40,7 @@ - +