Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cad9b83fb | |||
| 780ee76dc3 | |||
| 4d8e17f59f | |||
| 21c27e22da | |||
| 2e978089b5 | |||
| 803fe7147e | |||
| 6490364a5d | |||
| 2ad773952e | |||
| 138e71107e | |||
| bde399f589 | |||
| 8a43602363 | |||
| 5a56790fd4 | |||
| 892f681174 | |||
| 997b5420ee | |||
| 643bbe3af2 | |||
| f85f0f19b9 | |||
| 3f9a1bafa0 | |||
| 6f72a03ecf | |||
| 5b8e4c634e | |||
| 70c3f7162e | |||
| cb9199431a | |||
| cba9fe1e7b | |||
| baa49e77eb | |||
| b015462e50 | |||
| c9f1fc1bea | |||
| 1177886271 | |||
| 0e1c56dd18 | |||
| eefe237dff |
@@ -0,0 +1,10 @@
|
||||
.git
|
||||
.env
|
||||
node_modules
|
||||
packages
|
||||
vendor
|
||||
tests
|
||||
.DS_Store
|
||||
vapor.yml
|
||||
.vapor
|
||||
storage
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
APP_NAME=Investbrain
|
||||
APP_ENV=production
|
||||
APP_KEY=
|
||||
APP_DEBUG=false
|
||||
APP_DEBUG=true
|
||||
APP_TIMEZONE=UTC
|
||||
APP_PORT=8000
|
||||
APP_URL="http://localhost:${APP_PORT}"
|
||||
@@ -52,7 +52,7 @@ QUEUE_CONNECTION=redis
|
||||
CACHE_STORE=redis
|
||||
|
||||
REDIS_CLIENT=predis
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_HOST=investbrain-redis
|
||||
REDIS_PATH=/tmp/database_server.sock
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
name: Build and push Docker images
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GIT_HUB_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Extract version from tag
|
||||
id: extract-version
|
||||
run: |
|
||||
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: ./docker/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
investbrainapp/investbrain:latest
|
||||
investbrainapp/investbrain:${{ env.version }}
|
||||
ghcr.io/investbrainapp/investbrain:latest
|
||||
ghcr.io/investbrainapp/investbrain:${{ env.version }}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ Investbrain is a smart open-source investment tracker that helps you manage, tra
|
||||
- [Install (self hosting)](#self-hosting)
|
||||
- [Chat with your holdings](#chat-with-your-holdings)
|
||||
- [Market data providers](#market-data-providers)
|
||||
- [Import / Export](#import--export)
|
||||
- [Configuration](#configuration)
|
||||
- [Updating](#updating)
|
||||
- [Command line utilities](#command-line-utilities)
|
||||
@@ -19,7 +20,7 @@ Investbrain is a smart open-source investment tracker that helps you manage, tra
|
||||
|
||||
## Under the hood
|
||||
|
||||
Investbrain is a Laravel PHP web application that leverages Livewire and Tailwind for its frontend. Most databases should work, including MySQL and SQLite. Out of the box, we feature three market data providers: [Yahoo Finance](https://finance.yahoo.com/), [Finnhub](https://finnhub.io/pricing-stock-api-market-data), and [Alpha Vantage](https://www.alphavantage.co/support/). But we also offer an extensible market data provider interface for intrepid developers to create their own! We also offer an integration with OpenAI's LLMs for our ["chat with your holdings"](#chat-with-your-holdings) capability. Finally, of course we have robust support for i18n, a11y, and dark mode.
|
||||
Investbrain is a Laravel PHP web application that leverages Livewire and Tailwind for its frontend. Most databases should work, including MySQL and SQLite. Out of the box, we feature three market data providers: [Yahoo Finance](https://finance.yahoo.com/), [Finnhub](https://finnhub.io/pricing-stock-api-market-data), and [Alpha Vantage](https://www.alphavantage.co/support/). But we also offer an extensible market data provider interface for intrepid developers to create their own! We also offer integrations with OpenAI and Ollama for our ["chat with your holdings"](#chat-with-your-holdings) capability. Finally, of course we have robust support for i18n, a11y, and dark mode.
|
||||
|
||||
## Self hosting
|
||||
|
||||
@@ -57,7 +58,9 @@ Investbrain offers an AI powered chat assistant that is grounded on *your* inves
|
||||
|
||||
When self-hosting, you can enable the chat assistant by configuring your OpenAI Secret Key and Organization ID in your [.env](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file. Navigate to OpenAI to [create your keys](https://platform.openai.com/api-keys).
|
||||
|
||||
Always keep in mind the limitations of large language models. When in doubt, consult a licensed investment advisor.
|
||||
If you are self-hosting your own large language models ("LLMs") that expose an OpenAI compatible API (e.g. [Ollama](https://ollama.com/blog/openai-compatibility)), you can update the `OPENAI_BASE_URI` configuration to your self-hosted instance. Ensure you also update the `OPENAI_MODEL` to an available model.
|
||||
|
||||
Always keep in mind the limitations of LLMs. When in doubt, consult a licensed investment advisor.
|
||||
|
||||
## Market data providers
|
||||
|
||||
@@ -104,6 +107,18 @@ MARKET_DATA_PROVIDER=yahoo,alphavantage,custom_provider
|
||||
|
||||
Feel free to submit a PR with any custom providers you create.
|
||||
|
||||
## Import / Export
|
||||
|
||||
Investbrain includes a convenient feature which allows you to maintain the portability of your portfolios and transaction data.
|
||||
|
||||
### Import
|
||||
|
||||
Imports are "upserted" to the database. If the record does not already exist in the database, the record will be created. However, when a portfolio or transaction exists (i.e. the record's ID matches an existing record), the record will be updated. This way, you can simultaneously create new records, but also bulk update records.
|
||||
|
||||
### Export
|
||||
|
||||
Exporting your portfolios and transactions is a convenient way to back-up your Investbrain data. It is also a convenient way to maintain portability of *your* data.
|
||||
|
||||
## Configuration
|
||||
|
||||
There are several optional configurations available when installing using the recommended [Docker method](#self-hosting). These options are configurable using an environment file. Changes can be made in your [.env](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file before installation.
|
||||
@@ -120,11 +135,12 @@ There are several optional configurations available when installing using the re
|
||||
| AI_CHAT_ENABLED | Whether to enable AI chat features | `false` |
|
||||
| OPENAI_API_KEY | OpenAI secret key (required for AI chat) | `null` |
|
||||
| OPENAI_ORGANIZATION | OpenAI org id (required for AI chat) | `null` |
|
||||
| OPENAI_MODEL | The selected LLM used for AI chat | gpt-4o |
|
||||
| OPENAI_BASE_URI | The URI for your self-hosted LLM | api.openai.com/v1 |
|
||||
| DAILY_CHANGE_TIME | The time of day to capture daily change | 23:00 |
|
||||
| REGISTRATION_ENABLED | Whether to enable registration of new users | `true` |
|
||||
|
||||
|
||||
|
||||
> Note: These options affect the [docker-compose.yml](https://github.com/investbrainapp/investbrain/blob/main/docker-compose.yml) file, so if you decide to make any changes to these default configurations, you'll have to restart the Docker containers before your changes take effect.
|
||||
|
||||
## Updating
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
use Laravel\Jetstream\Features;
|
||||
use App\Actions\Jetstream\DeleteUser;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Jetstream\Jetstream;
|
||||
|
||||
@@ -26,6 +29,13 @@ class JetstreamServiceProvider extends ServiceProvider
|
||||
|
||||
Jetstream::deleteUsersUsing(DeleteUser::class);
|
||||
|
||||
if ( config('investbrain.self_hosted', false) ) {
|
||||
|
||||
Config::set(
|
||||
'jetstream.features',
|
||||
array_keys(Arr::except(array_values(config('jetstream.features')), Features::termsAndPrivacyPolicy()))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
"livewire/livewire": "^3.5",
|
||||
"livewire/volt": "^1.6",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"openai-php/laravel": "^0.10.2",
|
||||
"openai-php/client": "^0.10.3",
|
||||
"predis/predis": "^2.2",
|
||||
"robsontenorio/mary": "^1.35",
|
||||
"scheb/yahoo-finance-api": "^4.11",
|
||||
|
||||
Generated
+415
-444
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -143,7 +143,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'inject_morph_markers' => true,
|
||||
'inject_morph_markers' => false,
|
||||
|
||||
/*
|
||||
|---------------------------------------------------------------------------
|
||||
|
||||
@@ -27,5 +27,6 @@ return [
|
||||
'request_timeout' => env('OPENAI_REQUEST_TIMEOUT', 30),
|
||||
|
||||
//
|
||||
'base_uri' => env('OPENAI_BASE_URI', 'api.openai.com/v1'),
|
||||
'model' => env('OPENAI_MODEL', 'gpt-4o'),
|
||||
];
|
||||
|
||||
+12
-3
@@ -3,9 +3,7 @@ networks:
|
||||
driver: bridge
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
image: investbrainapp/investbrain:latest
|
||||
container_name: investbrain-app
|
||||
restart: unless-stopped
|
||||
tty: true
|
||||
@@ -15,8 +13,18 @@ services:
|
||||
- .:/var/www/app:delegated
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
- investbrain-network
|
||||
redis:
|
||||
image: redis:alpine
|
||||
container_name: investbrain-redis
|
||||
restart: unless-stopped
|
||||
tty: true
|
||||
networks:
|
||||
- investbrain-network
|
||||
volumes:
|
||||
- investbrain-redis:/data
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: investbrain-nginx
|
||||
@@ -46,4 +54,5 @@ services:
|
||||
networks:
|
||||
- investbrain-network
|
||||
volumes:
|
||||
investbrain-redis:
|
||||
investbrain-mysql:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
dump.rdb
|
||||
+34
-30
@@ -1,47 +1,51 @@
|
||||
FROM php:8.3-fpm
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Set the working directory
|
||||
COPY . /var/www/app
|
||||
WORKDIR /var/www/app
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R www-data:www-data . \
|
||||
&& chmod -R 775 ./storage \
|
||||
&& chmod +x ./docker/entrypoint.sh \
|
||||
# Install common php extension dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libfreetype-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libpng-dev \
|
||||
zlib1g-dev \
|
||||
libzip-dev \
|
||||
unzip \
|
||||
libicu-dev \
|
||||
git \
|
||||
curl \
|
||||
redis \
|
||||
supervisor \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j$(nproc) \
|
||||
gd \
|
||||
zip \
|
||||
pdo_mysql \
|
||||
mysqli \
|
||||
intl
|
||||
|
||||
&& apt-get update && apt-get install -y \
|
||||
libfreetype-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libpng-dev \
|
||||
zlib1g-dev \
|
||||
libzip-dev \
|
||||
unzip \
|
||||
libicu-dev \
|
||||
git \
|
||||
curl \
|
||||
supervisor \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j$(nproc) \
|
||||
gd \
|
||||
zip \
|
||||
pdo_mysql \
|
||||
mysqli \
|
||||
intl \
|
||||
# Install Node.js and npm
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& npm install -g npm@latest
|
||||
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& npm install -g npm@latest
|
||||
|
||||
# Copy over supervisor configuration
|
||||
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# Update permissions
|
||||
RUN chown -R www-data:www-data . \
|
||||
&& chmod -R 775 ./storage \
|
||||
&& chmod +x ./docker/entrypoint.sh
|
||||
|
||||
# install composer
|
||||
# Install composer
|
||||
COPY --from=composer:2.6.5 /usr/bin/composer /usr/local/bin/composer
|
||||
|
||||
# Serve on port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Set up healthcheck
|
||||
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl -f http://localhost || exit 1
|
||||
|
||||
# Run everything else
|
||||
ENTRYPOINT ["/bin/bash", "./docker/entrypoint.sh"]
|
||||
CMD ["./docker/entrypoint.sh"]
|
||||
|
||||
Executable → Regular
+20
-10
@@ -2,20 +2,17 @@
|
||||
|
||||
cd /var/www/app
|
||||
|
||||
echo "====================== Running entrypoint script... ====================== "
|
||||
echo -e "\n====================== Running entrypoint script... ====================== "
|
||||
if [ ! -f ".env" ]; then
|
||||
echo " > Ope, gotta create an .env file!"
|
||||
|
||||
cp .env.example .env
|
||||
fi
|
||||
|
||||
echo "====================== Checking for updates... ====================== "
|
||||
/usr/bin/git pull
|
||||
|
||||
echo "====================== Installing Composer dependencies... ====================== "
|
||||
echo -e "\n====================== Installing Composer dependencies... ====================== "
|
||||
/usr/local/bin/composer install
|
||||
|
||||
echo "====================== Validating environment... ====================== "
|
||||
echo -e "\n====================== Validating environment... ====================== "
|
||||
if [ $(stat -c '%U' .) != "www-data" ]; then
|
||||
echo " > Setting correct permissions for pwd..."
|
||||
chown -R www-data:www-data .
|
||||
@@ -33,12 +30,25 @@ if [ ! -L "public/storage" ]; then
|
||||
/usr/local/bin/php artisan storage:link
|
||||
fi
|
||||
|
||||
echo "====================== Installing NPM dependencies and building frontend... ====================== "
|
||||
echo -e "\n====================== Installing NPM dependencies and building frontend... ====================== "
|
||||
/usr/bin/npm install
|
||||
/usr/bin/npm run build
|
||||
|
||||
echo "====================== Running migrations... ====================== "
|
||||
/usr/local/bin/php artisan migrate --force
|
||||
echo -e "\n====================== Running migrations... ====================== "
|
||||
run_migrations() {
|
||||
/usr/local/bin/php artisan migrate --force
|
||||
}
|
||||
RETRIES=30
|
||||
DELAY=5
|
||||
until run_migrations; do
|
||||
RETRIES=$((RETRIES-1))
|
||||
if [ $RETRIES -le 0 ]; then
|
||||
echo " > Database is not ready after multiple attempts. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
echo " > Waiting for database to be ready... retrying in $DELAY seconds."
|
||||
sleep $DELAY
|
||||
done
|
||||
|
||||
echo "====================== Spinning up Supervisor daemon... ====================== "
|
||||
echo -e "\n====================== Spinning up Supervisor daemon... ====================== "
|
||||
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# Redis RDB and AOF file location
|
||||
dir /var/www/app/docker
|
||||
@@ -11,13 +11,6 @@ autorestart=true
|
||||
stdout_logfile=/var/log/supervisor/php.log
|
||||
stderr_logfile=/var/log/supervisor/php_error.log
|
||||
|
||||
[program:redis]
|
||||
command=redis-server /var/www/app/docker/redis.conf
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/supervisor/redis.log
|
||||
stderr_logfile=/var/log/supervisor/redis_error.log
|
||||
|
||||
[program:scheduler]
|
||||
command=php artisan schedule:work
|
||||
autorestart=true
|
||||
|
||||
Generated
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "investbrain",
|
||||
"name": "app",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
<x-ib-card title="{{ __('Recent activity') }}" class="md:col-span-3">
|
||||
|
||||
@livewire('transactions-list', [
|
||||
'transactions' => $user->transactions
|
||||
'transactions' => $user->transactions,
|
||||
'showPortfolio' => true,
|
||||
'paginate' => false
|
||||
])
|
||||
|
||||
</x-ib-card>
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
* 52 week high: {$holding->market_data->fifty_two_week_high}
|
||||
* Dividend yield: {$holding->market_data->dividend_yield}
|
||||
|
||||
Based on this current market data, quantity owned, and average cost basis, you should determine if the {$holding->symbol} holding is making or losing money.
|
||||
This data is current as of today's date: " . now()->format('Y-m-d') . ". Based on this current market data, quantity owned, and average cost basis, you should determine if the {$holding->symbol} holding is making or losing money.
|
||||
|
||||
Below is the question from the investor. Considering these facts, provide a concise response to the following question (give a direct response). Limit your response to no more than 75 words and consider using a common decision framework. Use github style markdown for any formatting:"
|
||||
])
|
||||
|
||||
@@ -5,7 +5,7 @@ use App\Models\AiChat;
|
||||
use App\Models\Holding;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Livewire\Volt\Component;
|
||||
use OpenAI\Laravel\Facades\OpenAI;
|
||||
use OpenAI\Factory;
|
||||
use OpenAI\Responses\StreamResponse;
|
||||
|
||||
new class extends Component {
|
||||
@@ -67,7 +67,9 @@ new class extends Component {
|
||||
{
|
||||
|
||||
try {
|
||||
$stream = OpenAI::chat()->createStreamed([
|
||||
$client = $this->createOpenAiClient();
|
||||
|
||||
$stream = $client->chat()->createStreamed([
|
||||
'model' => config('openai.model'),
|
||||
'messages' => [
|
||||
['role' => 'system', 'content' => "Today's date is "
|
||||
@@ -104,7 +106,9 @@ new class extends Component {
|
||||
public function generateSuggestedPrompts(): void
|
||||
{
|
||||
try {
|
||||
$suggested_prompts = OpenAI::chat()->create([
|
||||
$client = $this->createOpenAiClient();
|
||||
|
||||
$suggested_prompts = $client->chat()->create([
|
||||
'model' => config('openai.model'),
|
||||
'response_format' => [
|
||||
'type' => 'json_schema',
|
||||
@@ -192,6 +196,21 @@ new class extends Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
private function createOpenAiClient()
|
||||
{
|
||||
$apiKey = config('openai.api_key');
|
||||
$organization = config('openai.organization');
|
||||
$baseUri = config('openai.base_uri');
|
||||
|
||||
return OpenAI::factory()
|
||||
->withApiKey($apiKey)
|
||||
->withOrganization($organization)
|
||||
->withHttpHeader('OpenAI-Beta', 'assistants=v2')
|
||||
->withHttpClient(new \GuzzleHttp\Client(['timeout' => config('openai.request_timeout', 30)]))
|
||||
->withBaseUri($baseUri)
|
||||
->make();
|
||||
}
|
||||
|
||||
}; ?>
|
||||
|
||||
<div
|
||||
|
||||
@@ -15,6 +15,10 @@ new class extends Component {
|
||||
public ?Portfolio $portfolio;
|
||||
public ?Transaction $editingTransaction;
|
||||
public Bool $shouldGoToHolding = true;
|
||||
public Bool $showPortfolio = false;
|
||||
public Bool $paginate = true;
|
||||
public Int $perPage = 5;
|
||||
public Int $offset = 0;
|
||||
|
||||
protected $listeners = [
|
||||
'transaction-updated' => '$refresh',
|
||||
@@ -38,17 +42,23 @@ new class extends Component {
|
||||
return $this->redirect(route('holding.show', ['portfolio' => $holding['portfolio_id'], 'symbol' => $holding['symbol']]));
|
||||
}
|
||||
|
||||
public function updateOffset($amount = 0)
|
||||
{
|
||||
$this->offset = $this->offset + $amount;
|
||||
}
|
||||
|
||||
}; ?>
|
||||
|
||||
<div class="">
|
||||
|
||||
@foreach($transactions->sortByDesc('date')->take(10) as $transaction)
|
||||
@foreach($transactions->sortByDesc('date')->slice($offset)->take($perPage) as $transaction)
|
||||
|
||||
<x-list-item
|
||||
no-separator
|
||||
:item="$transaction"
|
||||
class="cursor-pointer"
|
||||
x-data="{ loading: false, timeout: null }"
|
||||
:key="$transaction->id"
|
||||
@click="
|
||||
if ($wire.shouldGoToHolding) {
|
||||
|
||||
@@ -83,12 +93,44 @@ new class extends Component {
|
||||
<x-loading x-show="loading" x-cloak class="text-gray-400 ml-2" />
|
||||
</x-slot:value>
|
||||
<x-slot:sub-value>
|
||||
@if($showPortfolio)
|
||||
<span title="{{ __('Portfolio') }}">{{ $transaction->portfolio->title }} </span>
|
||||
·
|
||||
@endif
|
||||
<span title="{{ __('Transaction Date') }}">{{ $transaction->date->format('F j, Y') }} </span>
|
||||
</x-slot:sub-value>
|
||||
</x-list-item>
|
||||
|
||||
@endforeach
|
||||
|
||||
@if ($paginate && count($transactions) > $perPage)
|
||||
<div class="flex justify-between">
|
||||
|
||||
<span>
|
||||
@if($offset > 0)
|
||||
<x-button
|
||||
class="btn btn-sm btn-ghost text-secondary"
|
||||
wire:click="updateOffset(-{{ $perPage }})"
|
||||
>
|
||||
{!! __('pagination.previous') !!}
|
||||
</x-button>
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<span>
|
||||
@if(count($transactions) - $offset > $offset)
|
||||
<x-button
|
||||
class="btn btn-sm btn-ghost text-secondary"
|
||||
wire:click="updateOffset({{ $perPage }})"
|
||||
>
|
||||
{!! __('pagination.next') !!}
|
||||
</x-button>
|
||||
@endif
|
||||
</span>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<x-ib-alpine-modal
|
||||
key="manage-transaction"
|
||||
title="{{ __('Manage Transaction') }}"
|
||||
@@ -96,7 +138,7 @@ new class extends Component {
|
||||
@livewire('manage-transaction-form', [
|
||||
'portfolio' => $portfolio,
|
||||
'transaction' => $editingTransaction,
|
||||
], key($editingTransaction->id ?? 'new'))
|
||||
], key($editingTransaction?->id.rand()))
|
||||
|
||||
</x-ib-alpine-modal>
|
||||
</div>
|
||||
@@ -173,7 +173,7 @@
|
||||
|
||||
{$formattedHoldings}
|
||||
|
||||
Based on the current market data, quantity owned, and average cost basis, you can determine the performance of any holding.
|
||||
This data is current as of today's date: " . now()->format('Y-m-d') . ". Based on the current market data, quantity owned, and average cost basis, you can determine the performance of any holding.
|
||||
|
||||
Below is the question from the investor. Considering these facts, provide a concise response to the following question (give a direct response). Limit your response to no more than 75 words and consider using a common decision framework. Use github style markdown for any formatting:"
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user