transaction)) { $this->symbol = $this->transaction->symbol; $this->transaction_type = $this->transaction->transaction_type; $this->date = $this->transaction->date->format('Y-m-d'); $this->quantity = $this->transaction->quantity; $this->cost_basis = $this->transaction->cost_basis; $this->sale_price = $this->transaction->sale_price; } else { $this->transaction_type = 'BUY'; $this->date = now()->format('Y-m-d'); } } public function update() { $this->transaction->update($this->validate()); // $this->transaction->owner_id = auth()->user()->id; $this->transaction->save(); $this->success(__('Transaction updated'), redirectTo: route('portfolio.show', ['portfolio' => $this->portfolio->id])); } public function save() { $transaction = $this->portfolio->transactions()->create($this->validate()); $transaction->save(); $this->success(__('Transaction created'), redirectTo: route('portfolio.show', ['portfolio' => $this->portfolio->id])); } public function delete() { $this->transaction->delete(); $this->success(__('Transaction deleted'), redirectTo: route('portfolio.show', ['portfolio' => $this->portfolio->id])); } }; ?>
@if($transaction_type == 'SELL') @else @endif @if ($transaction) @endif {{ __('Delete Transaction') }} {{ __('Are you sure you want to delete this transaction?') }} {{ __('Cancel') }} {{ __('Delete Transaction') }}