wip
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Holding;
|
||||
use App\Models\Portfolio;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -14,12 +15,13 @@ class HoldingController extends Controller
|
||||
public function show(Request $request, Portfolio $portfolio, String $symbol)
|
||||
{
|
||||
|
||||
$holding = $portfolio->holdings()
|
||||
->with(['market_data'])
|
||||
->symbol($symbol)
|
||||
->portfolio($portfolio->id)
|
||||
->first();
|
||||
$holding = Holding::with(['market_data'])
|
||||
->symbol($symbol)
|
||||
->portfolio($portfolio->id)
|
||||
->firstOrFail();
|
||||
|
||||
return view('holding.show', compact(['portfolio', 'holding']));
|
||||
$transactions = $holding->transactions;
|
||||
|
||||
return view('holding.show', compact(['portfolio', 'holding', 'transactions']));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user