Compare commits
59 Commits
v1.2.0-rc2
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a67717c2f8 | |||
| f24fd83ae1 | |||
| b1a517ce71 | |||
| d449a89349 | |||
| a98dcd0732 | |||
| eaaa218582 | |||
| 67396b23f1 | |||
| 01825e9108 | |||
| d55f117565 | |||
| 327e120a3c | |||
| 5e8324551b | |||
| 935a5020db | |||
| 0b9f7d5254 | |||
| 6ea4b5c12a | |||
| d3337c7c01 | |||
| 23a9b84659 | |||
| 6bc174a87b | |||
| 401b0eef91 | |||
| 98f47baa73 | |||
| 66889abc72 | |||
| fc6b7a8c52 | |||
| 34223960f8 | |||
| 5f583de857 | |||
| bb0a0ef928 | |||
| 2d4c7002a7 | |||
| 939e46eb61 | |||
| 04f1d8cbcd | |||
| c6032c5b66 | |||
| 8908e2da02 | |||
| 892d5a30e0 | |||
| b896513be9 | |||
| 013ccba050 | |||
| a10f94a570 | |||
| 5b8b9ae39e | |||
| 3e84ed7572 | |||
| 39458ef44e | |||
| 0e47b7538e | |||
| 0aaa51e736 | |||
| e6f38d9481 | |||
| 910d426ad4 | |||
| 72ad02de4b | |||
| 50285a3d51 | |||
| ff31e3d48b | |||
| 3d944afeb4 | |||
| 8e625107c1 | |||
| df034863c7 | |||
| 70cdfc9fd8 | |||
| a0bd776abb | |||
| afcafa6031 | |||
| 07c85697f3 | |||
| a882b5aadb | |||
| bad82fb41b | |||
| 5aca9008cb | |||
| 712a4c6c57 | |||
| 78f0d21b73 | |||
| 19cac58692 | |||
| 7d77b6fbc8 | |||
| e4e08091af | |||
| 292d43b154 |
+1
-2
@@ -16,9 +16,8 @@ REGISTRATION_ENABLED=true
|
||||
# Enable or disable AI chat feature
|
||||
AI_CHAT_ENABLED=false
|
||||
|
||||
# API key for OpenAI (for Llama support, see docs)
|
||||
# API key for OpenAI (for other labs or Ollama support, see docs)
|
||||
OPENAI_API_KEY=
|
||||
OPENAI_ORGANIZATION=
|
||||
|
||||
# Market data provider to use (comma separated list)
|
||||
MARKET_DATA_PROVIDER=yahoo
|
||||
|
||||
@@ -8,11 +8,9 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04 #ubuntu-latest
|
||||
# runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Increase swap space
|
||||
run: sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=5120 && sudo chmod 600 /var/swap.1 && sudo /sbin/mkswap /var/swap.1 && sudo /sbin/swapon /var/swap.1
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"laravel-boost": {
|
||||
"command": "php",
|
||||
"args": [
|
||||
"artisan",
|
||||
"boost:mcp"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,452 @@
|
||||
<laravel-boost-guidelines>
|
||||
=== foundation rules ===
|
||||
|
||||
# Laravel Boost Guidelines
|
||||
|
||||
The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to enhance the user's satisfaction building Laravel applications.
|
||||
|
||||
## Foundational Context
|
||||
This application is a Laravel application and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure you abide by these specific packages & versions.
|
||||
|
||||
- php - 8.4.18
|
||||
- laravel/fortify (FORTIFY) - v1
|
||||
- laravel/framework (LARAVEL) - v12
|
||||
- laravel/prompts (PROMPTS) - v0
|
||||
- laravel/sanctum (SANCTUM) - v4
|
||||
- laravel/socialite (SOCIALITE) - v5
|
||||
- livewire/livewire (LIVEWIRE) - v4
|
||||
- livewire/volt (VOLT) - v1
|
||||
- laravel/mcp (MCP) - v0
|
||||
- laravel/pint (PINT) - v1
|
||||
- phpunit/phpunit (PHPUNIT) - v11
|
||||
- alpinejs (ALPINEJS) - v3
|
||||
- tailwindcss (TAILWINDCSS) - v4
|
||||
|
||||
## Conventions
|
||||
- You must follow all existing code conventions used in this application. When creating or editing a file, check sibling files for the correct structure, approach, and naming.
|
||||
- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`.
|
||||
- Check for existing components to reuse before writing a new one.
|
||||
|
||||
## Verification Scripts
|
||||
- Do not create verification scripts or tinker when tests cover that functionality and prove it works. Unit and feature tests are more important.
|
||||
|
||||
## Application Structure & Architecture
|
||||
- Stick to existing directory structure; don't create new base folders without approval.
|
||||
- Do not change the application's dependencies without approval.
|
||||
|
||||
## Frontend Bundling
|
||||
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them.
|
||||
|
||||
## Replies
|
||||
- Be concise in your explanations - focus on what's important rather than explaining obvious details.
|
||||
|
||||
## Documentation Files
|
||||
- You must only create documentation files if explicitly requested by the user.
|
||||
|
||||
=== boost rules ===
|
||||
|
||||
## Laravel Boost
|
||||
- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them.
|
||||
|
||||
## Artisan
|
||||
- Use the `list-artisan-commands` tool when you need to call an Artisan command to double-check the available parameters.
|
||||
|
||||
## URLs
|
||||
- Whenever you share a project URL with the user, you should use the `get-absolute-url` tool to ensure you're using the correct scheme, domain/IP, and port.
|
||||
|
||||
## Tinker / Debugging
|
||||
- You should use the `tinker` tool when you need to execute PHP to debug code or query Eloquent models directly.
|
||||
- Use the `database-query` tool when you only need to read from the database.
|
||||
|
||||
## Reading Browser Logs With the `browser-logs` Tool
|
||||
- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost.
|
||||
- Only recent browser logs will be useful - ignore old logs.
|
||||
|
||||
## Searching Documentation (Critically Important)
|
||||
- Boost comes with a powerful `search-docs` tool you should use before any other approaches when dealing with Laravel or Laravel ecosystem packages. This tool automatically passes a list of installed packages and their versions to the remote Boost API, so it returns only version-specific documentation for the user's circumstance. You should pass an array of packages to filter on if you know you need docs for particular packages.
|
||||
- The `search-docs` tool is perfect for all Laravel-related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc.
|
||||
- You must use this tool to search for Laravel ecosystem documentation before falling back to other approaches.
|
||||
- Search the documentation before making code changes to ensure we are taking the correct approach.
|
||||
- Use multiple, broad, simple, topic-based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`.
|
||||
- Do not add package names to queries; package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`.
|
||||
|
||||
### Available Search Syntax
|
||||
- You can and should pass multiple queries at once. The most relevant results will be returned first.
|
||||
|
||||
1. Simple Word Searches with auto-stemming - query=authentication - finds 'authenticate' and 'auth'.
|
||||
2. Multiple Words (AND Logic) - query=rate limit - finds knowledge containing both "rate" AND "limit".
|
||||
3. Quoted Phrases (Exact Position) - query="infinite scroll" - words must be adjacent and in that order.
|
||||
4. Mixed Queries - query=middleware "rate limit" - "middleware" AND exact phrase "rate limit".
|
||||
5. Multiple Queries - queries=["authentication", "middleware"] - ANY of these terms.
|
||||
|
||||
=== php rules ===
|
||||
|
||||
## PHP
|
||||
|
||||
- Always use curly braces for control structures, even if it has one line.
|
||||
|
||||
### Constructors
|
||||
- Use PHP 8 constructor property promotion in `__construct()`.
|
||||
- <code-snippet>public function __construct(public GitHub $github) { }</code-snippet>
|
||||
- Do not allow empty `__construct()` methods with zero parameters unless the constructor is private.
|
||||
|
||||
### Type Declarations
|
||||
- Always use explicit return type declarations for methods and functions.
|
||||
- Use appropriate PHP type hints for method parameters.
|
||||
|
||||
<code-snippet name="Explicit Return Types and Method Params" lang="php">
|
||||
protected function isAccessible(User $user, ?string $path = null): bool
|
||||
{
|
||||
...
|
||||
}
|
||||
</code-snippet>
|
||||
|
||||
## Comments
|
||||
- Prefer PHPDoc blocks over inline comments. Never use comments within the code itself unless there is something very complex going on.
|
||||
|
||||
## PHPDoc Blocks
|
||||
- Add useful array shape type definitions for arrays when appropriate.
|
||||
|
||||
## Enums
|
||||
- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`.
|
||||
|
||||
=== herd rules ===
|
||||
|
||||
## Laravel Herd
|
||||
|
||||
- The application is served by Laravel Herd and will be available at: `https?://[kebab-case-project-dir].test`. Use the `get-absolute-url` tool to generate URLs for the user to ensure valid URLs.
|
||||
- You must not run any commands to make the site available via HTTP(S). It is always available through Laravel Herd.
|
||||
|
||||
=== tests rules ===
|
||||
|
||||
## Test Enforcement
|
||||
|
||||
- Every change must be programmatically tested. Write a new test or update an existing test, then run the affected tests to make sure they pass.
|
||||
- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test --compact` with a specific filename or filter.
|
||||
|
||||
=== laravel/core rules ===
|
||||
|
||||
## Do Things the Laravel Way
|
||||
|
||||
- Use `php artisan make:` commands to create new files (i.e. migrations, controllers, models, etc.). You can list available Artisan commands using the `list-artisan-commands` tool.
|
||||
- If you're creating a generic PHP class, use `php artisan make:class`.
|
||||
- Pass `--no-interaction` to all Artisan commands to ensure they work without user input. You should also pass the correct `--options` to ensure correct behavior.
|
||||
|
||||
### Database
|
||||
- Always use proper Eloquent relationship methods with return type hints. Prefer relationship methods over raw queries or manual joins.
|
||||
- Use Eloquent models and relationships before suggesting raw database queries.
|
||||
- Avoid `DB::`; prefer `Model::query()`. Generate code that leverages Laravel's ORM capabilities rather than bypassing them.
|
||||
- Generate code that prevents N+1 query problems by using eager loading.
|
||||
- Use Laravel's query builder for very complex database operations.
|
||||
|
||||
### Model Creation
|
||||
- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using `list-artisan-commands` to check the available options to `php artisan make:model`.
|
||||
|
||||
### APIs & Eloquent Resources
|
||||
- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention.
|
||||
|
||||
### Controllers & Validation
|
||||
- Always create Form Request classes for validation rather than inline validation in controllers. Include both validation rules and custom error messages.
|
||||
- Check sibling Form Requests to see if the application uses array or string based validation rules.
|
||||
|
||||
### Queues
|
||||
- Use queued jobs for time-consuming operations with the `ShouldQueue` interface.
|
||||
|
||||
### Authentication & Authorization
|
||||
- Use Laravel's built-in authentication and authorization features (gates, policies, Sanctum, etc.).
|
||||
|
||||
### URL Generation
|
||||
- When generating links to other pages, prefer named routes and the `route()` function.
|
||||
|
||||
### Configuration
|
||||
- Use environment variables only in configuration files - never use the `env()` function directly outside of config files. Always use `config('app.name')`, not `env('APP_NAME')`.
|
||||
|
||||
### Testing
|
||||
- When creating models for tests, use the factories for the models. Check if the factory has custom states that can be used before manually setting up the model.
|
||||
- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`.
|
||||
- When creating tests, make use of `php artisan make:test [options] {name}` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests.
|
||||
|
||||
### Vite Error
|
||||
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `npm run build` or ask the user to run `npm run dev` or `composer run dev`.
|
||||
|
||||
=== laravel/v12 rules ===
|
||||
|
||||
## Laravel 12
|
||||
|
||||
- Use the `search-docs` tool to get version-specific documentation.
|
||||
- Since Laravel 11, Laravel has a new streamlined file structure which this project uses.
|
||||
|
||||
### Laravel 12 Structure
|
||||
- In Laravel 12, middleware are no longer registered in `app/Http/Kernel.php`.
|
||||
- Middleware are configured declaratively in `bootstrap/app.php` using `Application::configure()->withMiddleware()`.
|
||||
- `bootstrap/app.php` is the file to register middleware, exceptions, and routing files.
|
||||
- `bootstrap/providers.php` contains application specific service providers.
|
||||
- The `app\Console\Kernel.php` file no longer exists; use `bootstrap/app.php` or `routes/console.php` for console configuration.
|
||||
- Console commands in `app/Console/Commands/` are automatically available and do not require manual registration.
|
||||
|
||||
### Database
|
||||
- When modifying a column, the migration must include all of the attributes that were previously defined on the column. Otherwise, they will be dropped and lost.
|
||||
- Laravel 12 allows limiting eagerly loaded records natively, without external packages: `$query->latest()->limit(10);`.
|
||||
|
||||
### Models
|
||||
- Casts can and likely should be set in a `casts()` method on a model rather than the `$casts` property. Follow existing conventions from other models.
|
||||
|
||||
=== livewire/core rules ===
|
||||
|
||||
## Livewire
|
||||
|
||||
- Use the `search-docs` tool to find exact version-specific documentation for how to write Livewire and Livewire tests.
|
||||
- Use the `php artisan make:livewire [Posts\CreatePost]` Artisan command to create new components.
|
||||
- State should live on the server, with the UI reflecting it.
|
||||
- All Livewire requests hit the Laravel backend; they're like regular HTTP requests. Always validate form data and run authorization checks in Livewire actions.
|
||||
|
||||
## Livewire Best Practices
|
||||
- Livewire components require a single root element.
|
||||
- Use `wire:loading` and `wire:dirty` for delightful loading states.
|
||||
- Add `wire:key` in loops:
|
||||
|
||||
```blade
|
||||
@foreach ($items as $item)
|
||||
<div wire:key="item-{{ $item->id }}">
|
||||
{{ $item->name }}
|
||||
</div>
|
||||
@endforeach
|
||||
```
|
||||
|
||||
- Prefer lifecycle hooks like `mount()`, `updatedFoo()` for initialization and reactive side effects:
|
||||
|
||||
<code-snippet name="Lifecycle Hook Examples" lang="php">
|
||||
public function mount(User $user) { $this->user = $user; }
|
||||
public function updatedSearch() { $this->resetPage(); }
|
||||
</code-snippet>
|
||||
|
||||
## Testing Livewire
|
||||
|
||||
<code-snippet name="Example Livewire Component Test" lang="php">
|
||||
Livewire::test(Counter::class)
|
||||
->assertSet('count', 0)
|
||||
->call('increment')
|
||||
->assertSet('count', 1)
|
||||
->assertSee(1)
|
||||
->assertStatus(200);
|
||||
</code-snippet>
|
||||
|
||||
<code-snippet name="Testing Livewire Component Exists on Page" lang="php">
|
||||
$this->get('/posts/create')
|
||||
->assertSeeLivewire(CreatePost::class);
|
||||
</code-snippet>
|
||||
|
||||
=== volt/core rules ===
|
||||
|
||||
## Livewire Volt
|
||||
|
||||
- This project uses Livewire Volt for interactivity within its pages. New pages requiring interactivity must also use Livewire Volt.
|
||||
- Make new Volt components using `php artisan make:volt [name] [--test] [--pest]`.
|
||||
- Volt is a class-based and functional API for Livewire that supports single-file components, allowing a component's PHP logic and Blade templates to coexist in the same file.
|
||||
- Livewire Volt allows PHP logic and Blade templates in one file. Components use the `@volt` directive.
|
||||
- You must check existing Volt components to determine if they're functional or class-based. If you can't detect that, ask the user which they prefer before writing a Volt component.
|
||||
|
||||
### Volt Functional Component Example
|
||||
|
||||
<code-snippet name="Volt Functional Component Example" lang="php">
|
||||
@volt
|
||||
<?php
|
||||
use function Livewire\Volt\{state, computed};
|
||||
|
||||
state(['count' => 0]);
|
||||
|
||||
$increment = fn () => $this->count++;
|
||||
$decrement = fn () => $this->count--;
|
||||
|
||||
$double = computed(fn () => $this->count * 2);
|
||||
?>
|
||||
|
||||
<div>
|
||||
<h1>Count: {{ $count }}</h1>
|
||||
<h2>Double: {{ $this->double }}</h2>
|
||||
<button wire:click="increment">+</button>
|
||||
<button wire:click="decrement">-</button>
|
||||
</div>
|
||||
@endvolt
|
||||
</code-snippet>
|
||||
|
||||
### Volt Class Based Component Example
|
||||
To get started, define an anonymous class that extends Livewire\Volt\Component. Within the class, you may utilize all of the features of Livewire using traditional Livewire syntax:
|
||||
|
||||
<code-snippet name="Volt Class-based Volt Component Example" lang="php">
|
||||
use Livewire\Volt\Component;
|
||||
|
||||
new class extends Component {
|
||||
public $count = 0;
|
||||
|
||||
public function increment()
|
||||
{
|
||||
$this->count++;
|
||||
}
|
||||
} ?>
|
||||
|
||||
<div>
|
||||
<h1>{{ $count }}</h1>
|
||||
<button wire:click="increment">+</button>
|
||||
</div>
|
||||
</code-snippet>
|
||||
|
||||
### Testing Volt & Volt Components
|
||||
- Use the existing directory for tests if it already exists. Otherwise, fallback to `tests/Feature/Volt`.
|
||||
|
||||
<code-snippet name="Livewire Test Example" lang="php">
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
test('counter increments', function () {
|
||||
Volt::test('counter')
|
||||
->assertSee('Count: 0')
|
||||
->call('increment')
|
||||
->assertSee('Count: 1');
|
||||
});
|
||||
</code-snippet>
|
||||
|
||||
<code-snippet name="Volt Component Test Using Pest" lang="php">
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\{User, Product};
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
test('product form creates product', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
Volt::test('pages.products.create')
|
||||
->actingAs($user)
|
||||
->set('form.name', 'Test Product')
|
||||
->set('form.description', 'Test Description')
|
||||
->set('form.price', 99.99)
|
||||
->call('create')
|
||||
->assertHasNoErrors();
|
||||
|
||||
expect(Product::where('name', 'Test Product')->exists())->toBeTrue();
|
||||
});
|
||||
</code-snippet>
|
||||
|
||||
### Common Patterns
|
||||
|
||||
<code-snippet name="CRUD With Volt" lang="php">
|
||||
<?php
|
||||
|
||||
use App\Models\Product;
|
||||
use function Livewire\Volt\{state, computed};
|
||||
|
||||
state(['editing' => null, 'search' => '']);
|
||||
|
||||
$products = computed(fn() => Product::when($this->search,
|
||||
fn($q) => $q->where('name', 'like', "%{$this->search}%")
|
||||
)->get());
|
||||
|
||||
$edit = fn(Product $product) => $this->editing = $product->id;
|
||||
$delete = fn(Product $product) => $product->delete();
|
||||
|
||||
?>
|
||||
|
||||
<!-- HTML / UI Here -->
|
||||
</code-snippet>
|
||||
|
||||
<code-snippet name="Real-Time Search With Volt" lang="php">
|
||||
<flux:input
|
||||
wire:model.live.debounce.300ms="search"
|
||||
placeholder="Search..."
|
||||
/>
|
||||
</code-snippet>
|
||||
|
||||
<code-snippet name="Loading States With Volt" lang="php">
|
||||
<flux:button wire:click="save" wire:loading.attr="disabled">
|
||||
<span wire:loading.remove>Save</span>
|
||||
<span wire:loading>Saving...</span>
|
||||
</flux:button>
|
||||
</code-snippet>
|
||||
|
||||
=== pint/core rules ===
|
||||
|
||||
## Laravel Pint Code Formatter
|
||||
|
||||
- You must run `vendor/bin/pint --dirty --format agent` before finalizing changes to ensure your code matches the project's expected style.
|
||||
- Do not run `vendor/bin/pint --test --format agent`, simply run `vendor/bin/pint --format agent` to fix any formatting issues.
|
||||
|
||||
=== phpunit/core rules ===
|
||||
|
||||
## PHPUnit
|
||||
|
||||
- This application uses PHPUnit for testing. All tests must be written as PHPUnit classes. Use `php artisan make:test --phpunit {name}` to create a new test.
|
||||
- If you see a test using "Pest", convert it to PHPUnit.
|
||||
- Every time a test has been updated, run that singular test.
|
||||
- When the tests relating to your feature are passing, ask the user if they would like to also run the entire test suite to make sure everything is still passing.
|
||||
- Tests should test all of the happy paths, failure paths, and weird paths.
|
||||
- You must not remove any tests or test files from the tests directory without approval. These are not temporary or helper files; these are core to the application.
|
||||
|
||||
### Running Tests
|
||||
- Run the minimal number of tests, using an appropriate filter, before finalizing.
|
||||
- To run all tests: `php artisan test --compact`.
|
||||
- To run all tests in a file: `php artisan test --compact tests/Feature/ExampleTest.php`.
|
||||
- To filter on a particular test name: `php artisan test --compact --filter=testName` (recommended after making a change to a related file).
|
||||
|
||||
=== tailwindcss/core rules ===
|
||||
|
||||
## Tailwind CSS
|
||||
|
||||
- Use Tailwind CSS classes to style HTML; check and use existing Tailwind conventions within the project before writing your own.
|
||||
- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc.).
|
||||
- Think through class placement, order, priority, and defaults. Remove redundant classes, add classes to parent or child carefully to limit repetition, and group elements logically.
|
||||
- You can use the `search-docs` tool to get exact examples from the official documentation when needed.
|
||||
|
||||
### Spacing
|
||||
- When listing items, use gap utilities for spacing; don't use margins.
|
||||
|
||||
<code-snippet name="Valid Flex Gap Spacing Example" lang="html">
|
||||
<div class="flex gap-8">
|
||||
<div>Superior</div>
|
||||
<div>Michigan</div>
|
||||
<div>Erie</div>
|
||||
</div>
|
||||
</code-snippet>
|
||||
|
||||
### Dark Mode
|
||||
- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`.
|
||||
|
||||
=== tailwindcss/v4 rules ===
|
||||
|
||||
## Tailwind CSS 4
|
||||
|
||||
- Always use Tailwind CSS v4; do not use the deprecated utilities.
|
||||
- `corePlugins` is not supported in Tailwind v4.
|
||||
- In Tailwind v4, configuration is CSS-first using the `@theme` directive — no separate `tailwind.config.js` file is needed.
|
||||
|
||||
<code-snippet name="Extending Theme in CSS" lang="css">
|
||||
@theme {
|
||||
--color-brand: oklch(0.72 0.11 178);
|
||||
}
|
||||
</code-snippet>
|
||||
|
||||
- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3:
|
||||
|
||||
<code-snippet name="Tailwind v4 Import Tailwind Diff" lang="diff">
|
||||
- @tailwind base;
|
||||
- @tailwind components;
|
||||
- @tailwind utilities;
|
||||
+ @import "tailwindcss";
|
||||
</code-snippet>
|
||||
|
||||
### Replaced Utilities
|
||||
- Tailwind v4 removed deprecated utilities. Do not use the deprecated option; use the replacement.
|
||||
- Opacity values are still numeric.
|
||||
|
||||
| Deprecated | Replacement |
|
||||
|------------+--------------|
|
||||
| bg-opacity-* | bg-black/* |
|
||||
| text-opacity-* | text-black/* |
|
||||
| border-opacity-* | border-black/* |
|
||||
| divide-opacity-* | divide-black/* |
|
||||
| ring-opacity-* | ring-black/* |
|
||||
| placeholder-opacity-* | placeholder-black/* |
|
||||
| flex-shrink-* | shrink-* |
|
||||
| flex-grow-* | grow-* |
|
||||
| overflow-ellipsis | text-ellipsis |
|
||||
| decoration-slice | box-decoration-slice |
|
||||
| decoration-clone | box-decoration-clone |
|
||||
</laravel-boost-guidelines>
|
||||
@@ -28,7 +28,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 many market data providers. 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.
|
||||
Investbrain is a Laravel PHP web application that has an extensible market data provider interface. Out of the box, we feature many market data providers. But intrepid developers can [create their own providers](#custom-providers)! 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
|
||||
|
||||
@@ -50,8 +50,6 @@ curl -O https://raw.githubusercontent.com/investbrainapp/investbrain/main/docker
|
||||
|
||||
Adjust the `environment` properties in the compose file to your preferences.
|
||||
|
||||
**Importantly**, you need to set the `APP_KEY` value. If you're unsure, Investbrain will generate an `APP_KEY` for you on first run, but it will not persist. You must _manually_ update your environment configuration with this generated value!
|
||||
|
||||
**3. Run `docker compose up`**
|
||||
|
||||
It might take a few minutes to pull the Docker images. But assuming everything worked as expected, you should now be able to access Investbrain in the browser by visiting:
|
||||
@@ -66,9 +64,11 @@ Congrats! You've just installed Investbrain!
|
||||
|
||||
Investbrain offers an AI powered chat assistant that is grounded on *your* investments. This enables you to use AI as a thought partner when making investment decisions.
|
||||
|
||||
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).
|
||||
Most of the major labs are currently supported (OpenAI, Anthropic, Gemini, xAI, etc). You'll need to obtain API keys from your selected provider and configure that in your [.env](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file using the appropriate keys.
|
||||
|
||||
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.
|
||||
Investbrain is also compatible with Ollama (and other OpenAI compatible APIs). If you are self-hosting your own large language models ("LLMs") that exposes an OpenAI compatible API (e.g. [Ollama](https://ollama.com/blog/openai-compatibility)), you'll need to configure your local endpoint in your [.env](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file.
|
||||
|
||||
See available options [below](#configuration).
|
||||
|
||||
Always keep in mind the limitations of LLMs. When in doubt, consult a licensed investment advisor.
|
||||
|
||||
@@ -76,7 +76,7 @@ Always keep in mind the limitations of LLMs. When in doubt, consult a licensed i
|
||||
|
||||
Investbrain includes an extensible market data provider interface that allows you to retrieve stock market data from multiple providers, such as [Yahoo Finance](https://finance.yahoo.com/), [Twelve Data](https://twelvedata.com), [Finnhub](https://finnhub.io/pricing-stock-api-market-data), [Alpaca](https://alpaca.markets/), and [Alpha Vantage](https://www.alphavantage.co/support/). The interface includes a built-in fallback mechanism to ensure reliable data access, even if a provider fails.
|
||||
|
||||
### Configuration
|
||||
### Market Data Configuration
|
||||
|
||||
You can specify the market data provider you want to use in your environment variables:
|
||||
|
||||
@@ -92,7 +92,7 @@ Your selected providers should be listed in your environment variables. Each sho
|
||||
MARKET_DATA_PROVIDER=yahoo,alphavantage
|
||||
```
|
||||
|
||||
In the above example, Yahoo Finance will be attempted first and the Alpha Vantage provider will be used as the fallback. If Yahoo Finance fails to retrieve market data, the application will automatically try Alpha Vantage.
|
||||
In the above example, Yahoo Finance will be attempted first. If Yahoo Finance fails to retrieve market data, the application will automatically try Alpha Vantage.
|
||||
|
||||
### Custom providers
|
||||
|
||||
@@ -137,7 +137,7 @@ There are several optional configurations available when installing using the re
|
||||
| ------------- | ------------- | ------------- |
|
||||
| APP_URL | The URL where your Investbrain installation will be accessible | http://localhost |
|
||||
| APP_PORT | The HTTP port exposed by the NGINX container | 8000 |
|
||||
| APP_KEY | Must be set during install - encryption key for various security-related functions | `null` |
|
||||
| APP_KEY | Encryption key for various security-related functions | Set automatically during install |
|
||||
| MARKET_DATA_PROVIDER | The market data provider to use (either `yahoo`, `twelvedata`, `alphavantage`, `alpaca`, or `finnhub`) | yahoo |
|
||||
| ALPHAVANTAGE_API_KEY | If using the Alpha Vantage provider | `null` |
|
||||
| FINNHUB_API_KEY | If using the Finnhub provider | `null` |
|
||||
@@ -147,10 +147,12 @@ There are several optional configurations available when installing using the re
|
||||
| MARKET_DATA_REFRESH | Cadence to refresh market data in minutes | 30 |
|
||||
| APP_TIMEZONE | Timezone for the application, including daily change captures | UTC |
|
||||
| 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 |
|
||||
| CHAT_PROVIDER | Which chat provider to use (one of `openai`, `anthropic`, `gemini`, `azure`, `groq`, `xai`, `deepseek`, `mistral`, `ollama`) | `openai` |
|
||||
| CHAT_MODEL | The selected LLM used for AI chat | defaults to current smartest model from lab |
|
||||
| ANTHROPIC_API_KEY | If using Anthropic for chat | `null` |
|
||||
| OPENAI_API_KEY | If using OpenAI for chat | `null` |
|
||||
| OLLAMA_BASE_URL | If using Ollama for chat | `http://localhost:11434` |
|
||||
| OLLAMA_API_KEY | May be required if using Ollama for chat | `null` |
|
||||
| DAILY_CHANGE_TIME | The time of day to capture daily change | 23:00 |
|
||||
| REGISTRATION_ENABLED | Whether to enable registration of new users | `true` |
|
||||
|
||||
@@ -181,7 +183,7 @@ Easy as that!
|
||||
|
||||
## Command line utilities
|
||||
|
||||
Investbrain comes bundled with several helpful command line utilities to make managing your portfolios and holdings more efficient. Keep in mind these commands are extremely powerful and can make irreversable changes to your holdings.
|
||||
Investbrain comes bundled with several helpful command line utilities to make managing your portfolios and holdings more efficient. Keep in mind these commands are extremely powerful and can make irreversable changes to your holdings. Just to be safe, we recommend backing up your portfolios before using these commands.
|
||||
|
||||
To run these commands, you can use `docker exec` like this:
|
||||
|
||||
@@ -189,7 +191,12 @@ To run these commands, you can use `docker exec` like this:
|
||||
docker exec -it investbrain-app php artisan <replace with command you want to run>
|
||||
```
|
||||
|
||||
Just to be safe, we recommend backing up your portfolios before using these commands:
|
||||
If you need more details on what the command does, you can take a look at the options available using the `help` option:
|
||||
|
||||
```bash
|
||||
<command you want to run> --help
|
||||
```
|
||||
|
||||
|
||||
| Command | Description |
|
||||
| ------------- | ------------- |
|
||||
@@ -198,8 +205,9 @@ Just to be safe, we recommend backing up your portfolios before using these comm
|
||||
| refresh:split-data | Refreshes splits data with your configured market data provider. Will also create new transactions to account for any splits. |
|
||||
| refresh:currency-data | Grabs the latest daily currency exchange rate data and persists to the database. |
|
||||
| capture:daily-change | Captures a snapshot of each portfolio's daily performance. |
|
||||
| sync:daily-change | Re-calculates daily snapshots of your portfolio's daily performance. Useful to fill in gaps in your portfolio charts. (Note: this is an extremely resource intensive query.) |
|
||||
| sync:holdings | Re-calculates performance of holdings with related transactions (i.e. dividends, realized gains, etc). |
|
||||
| sync:daily-change | Syncs daily snapshots of your portfolio's daily performance. Useful to fill in gaps in your portfolio charts. (Note: this is an extremely resource intensive query.) |
|
||||
| sync:holdings | Syncs performance of holdings with related transactions (i.e. dividends, realized gains, etc). |
|
||||
| fix:cost-basis-for-sales | Utility to automatically re-calculates cost basis for sale transactions. |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 1.1.x | :white_check_mark: |
|
||||
| 1.2.x | :white_check_mark: |
|
||||
| 1.1.x | :x: |
|
||||
| 1.0.x | :x: |
|
||||
| < 1.0.0 | :x: |
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class EnsureDailyChangeIsSynced
|
||||
) {
|
||||
defer(fn () => $model->portfolio->syncDailyChanges());
|
||||
|
||||
Cache::put($cacheKey, now(), now()->addMinutes(5));
|
||||
Cache::put($cacheKey, true, now()->addMinutes(5));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Actions\Jetstream;
|
||||
|
||||
use App\Models\User;
|
||||
use Laravel\Jetstream\Contracts\DeletesUsers;
|
||||
|
||||
class DeleteUser implements DeletesUsers
|
||||
{
|
||||
/**
|
||||
* Delete the given user.
|
||||
*/
|
||||
public function delete(User $user): void
|
||||
{
|
||||
$user->deleteProfilePhoto();
|
||||
$user->tokens->each->delete();
|
||||
$user->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Ai\Agents;
|
||||
|
||||
use App\Models\Holding;
|
||||
use Laravel\Ai\Concerns\RemembersConversations;
|
||||
use Laravel\Ai\Contracts\Agent;
|
||||
use Laravel\Ai\Contracts\Conversational;
|
||||
use Laravel\Ai\Contracts\HasTools;
|
||||
use Laravel\Ai\Contracts\Tool;
|
||||
use Laravel\Ai\Promptable;
|
||||
use Stringable;
|
||||
|
||||
class ChatWithHoldingAgent implements Agent, Conversational, HasTools
|
||||
{
|
||||
use Promptable;
|
||||
use RemembersConversations;
|
||||
|
||||
public function __construct(public readonly Holding $holding) {}
|
||||
|
||||
/**
|
||||
* Get the instructions that the agent should follow.
|
||||
*/
|
||||
public function instructions(): Stringable|string
|
||||
{
|
||||
$holding = $this->holding;
|
||||
$quantity = $holding->quantity > 0
|
||||
? 'a total of '.$holding->quantity
|
||||
: 'ZERO';
|
||||
|
||||
return 'Most recent training data: '.now()->toDateString().'.
|
||||
|
||||
You are an investment portfolio assistant providing advice to an investor. Use the following information to provide relevant recommendations. Use the words \'likely\' or \'may\' instead of concrete statements (except for obvious statements of fact or common sense). Do not apologize. Be polite, but minimize gratuitous niceties. If something is unclear, ask for clarification. When referencing numbers with precision, always round to the nearest 100th decimal place. If no precision, display numbers in integers.
|
||||
|
||||
The investor owns '.$quantity.' shares of '.$holding->market_data->name.' (ticker: '.$holding->symbol.') with an average cost basis of '.$holding->average_cost_basis.'. Here are the relevant transactions - sales and purchases of '.$holding->symbol.':
|
||||
|
||||
'.$holding->getFormattedTransactions().'
|
||||
|
||||
This investor has earned $ '.$holding->dividends_earned.' in dividends so far and earned '.$holding->realized_gains_dollars.' in realized gains (sales) from '.$holding->symbol.' in this portfolio.
|
||||
|
||||
The current market price for '.$holding->symbol.' is '.$holding->market_data->market_value.'. Additionally, here\'s other critical fundamentals for '.$holding->market_data->name.' that might help:
|
||||
* Market cap: '.$holding->market_data->market_cap.'
|
||||
* Forward PE: '.$holding->market_data->forward_pe.'
|
||||
* Trailing PE: '.$holding->market_data->trailing_pe.'
|
||||
* Book value: '.$holding->market_data->book_value.'
|
||||
* 52 week low: '.$holding->market_data->fifty_two_week_low.'
|
||||
* 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.
|
||||
|
||||
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:';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tools available to the agent.
|
||||
*
|
||||
* @return Tool[]
|
||||
*/
|
||||
public function tools(): iterable
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Ai\Agents;
|
||||
|
||||
use App\Models\Portfolio;
|
||||
use Laravel\Ai\Concerns\RemembersConversations;
|
||||
use Laravel\Ai\Contracts\Agent;
|
||||
use Laravel\Ai\Contracts\Conversational;
|
||||
use Laravel\Ai\Contracts\HasTools;
|
||||
use Laravel\Ai\Contracts\Tool;
|
||||
use Laravel\Ai\Promptable;
|
||||
use Stringable;
|
||||
|
||||
class ChatWithPortfolioAgent implements Agent, Conversational, HasTools
|
||||
{
|
||||
use Promptable;
|
||||
use RemembersConversations;
|
||||
|
||||
public function __construct(public readonly Portfolio $portfolio) {}
|
||||
|
||||
/**
|
||||
* Get the instructions that the agent should follow.
|
||||
*/
|
||||
public function instructions(): Stringable|string
|
||||
{
|
||||
return 'Most recent training data: '.now()->toDateString().'.
|
||||
|
||||
You are an investment portfolio assistant providing advice to an investor. Use the following information to provide relevant recommendations. Use the words \'likely\' or \'may\' in lieu of concrete statements (except for obvious statements of fact or common sense). Do not apologize. Be polite, but minimize gratuitous niceties. When referencing numbers with precision, always round to the nearest 100th decimal place. If no precision, display numbers in integers.
|
||||
|
||||
The investor has the following holdings in this portfolio:
|
||||
|
||||
'.$this->portfolio->getFormattedHoldings().'
|
||||
|
||||
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:';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tools available to the agent.
|
||||
*
|
||||
* @return Tool[]
|
||||
*/
|
||||
public function tools(): iterable
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Ai\Agents;
|
||||
|
||||
use Illuminate\Contracts\JsonSchema\JsonSchema;
|
||||
use Laravel\Ai\Contracts\Agent;
|
||||
use Laravel\Ai\Contracts\HasStructuredOutput;
|
||||
use Laravel\Ai\Contracts\HasTools;
|
||||
use Laravel\Ai\Contracts\Messages;
|
||||
use Laravel\Ai\Contracts\Tool;
|
||||
use Laravel\Ai\Promptable;
|
||||
use Stringable;
|
||||
|
||||
class ChatWithSuggestedPromptsAgent implements Agent, HasStructuredOutput, HasTools
|
||||
{
|
||||
use Promptable;
|
||||
|
||||
public function __construct(
|
||||
public array $messages
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Get the instructions that the agent should follow.
|
||||
*/
|
||||
public function instructions(): Stringable|string
|
||||
{
|
||||
return 'Your role is a savvy helper that assists curious investors in asking thoughtful questions to investment advisors.
|
||||
|
||||
You should recommend between 1 and 5 (no more than 5) questions. You should ensure the questions you recommend are based on the provided context. Be sure to keep the questions short!
|
||||
|
||||
The questions you recommend might be based on natural follow up from the given context, requests to further refine a previous response, clarify undefined terms, common decision frameworks, possible risks or benefits, or commonly understood investing concepts that may require additional explanation.
|
||||
|
||||
Generate between 1 and 5 (no more than 5) follow up questions a curious investor might ask their advisor based on the provided conversation.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tools available to the agent.
|
||||
*
|
||||
* @return Tool[]
|
||||
*/
|
||||
public function tools(): iterable
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the messages available to the agent.
|
||||
*
|
||||
* @return Messages[]
|
||||
*/
|
||||
public function messages(): iterable
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the agent's structured output schema definition.
|
||||
*/
|
||||
public function schema(JsonSchema $schema): array
|
||||
{
|
||||
return [
|
||||
'suggested_prompts' => $schema->array()->items(
|
||||
$schema->object([
|
||||
'text' => $schema->string()
|
||||
->description('Short description of suggested prompt (no more than 5 words)')
|
||||
->required(),
|
||||
'value' => $schema->string()
|
||||
->description('The detailed version of the prompt (think good prompt engineering!)')
|
||||
->required(),
|
||||
])->withoutAdditionalProperties()
|
||||
)->required(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Portfolio;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class FixCostBasisForSales extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'fix:cost-basis-for-sales
|
||||
{--portfolio= : The ID of the portfolio to fix.}
|
||||
{--user= : The user ID of transactions to fix.}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Fixes broken costs basis for sale transactions';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
if (empty($this->option('user')) && empty($this->option('portfolio'))) {
|
||||
|
||||
$this->error('Must provide at least a user or portfolio.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$transactions = Transaction::where(['transaction_type' => 'SELL']);
|
||||
|
||||
if ($this->option('user')) {
|
||||
|
||||
$portfolios = Portfolio::fullAccess($this->option('user'))->get('id')
|
||||
->pluck('id')
|
||||
->toArray();
|
||||
|
||||
$transactions->whereIn('portfolio_id', $portfolios);
|
||||
|
||||
} else {
|
||||
|
||||
$transactions->where(['portfolio_id' => $this->option('portfolio')]);
|
||||
}
|
||||
|
||||
$transactions = $transactions->get();
|
||||
|
||||
$this->line("Fixing cost basis for {$transactions->count()} sale transactions...");
|
||||
|
||||
$transactions->chunk(10)->each(function ($chunk) {
|
||||
|
||||
dispatch(function () use ($chunk) {
|
||||
|
||||
$chunk->each(function ($transaction) {
|
||||
|
||||
$cost_basis = Transaction::where([
|
||||
'portfolio_id' => $transaction->portfolio_id,
|
||||
'symbol' => $transaction->symbol,
|
||||
'transaction_type' => 'BUY',
|
||||
])->whereDate('date', '<=', $transaction->date)
|
||||
->selectRaw('SUM(transactions.cost_basis * transactions.quantity) as total_cost_basis')
|
||||
->selectRaw('SUM(transactions.quantity) as total_quantity')
|
||||
->first();
|
||||
|
||||
$average_cost_basis = empty($cost_basis->total_quantity)
|
||||
? 0
|
||||
: $cost_basis->total_cost_basis / $cost_basis->total_quantity;
|
||||
|
||||
$transaction->cost_basis = $average_cost_basis ?? 0;
|
||||
|
||||
$transaction->save();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$this->line('Done!');
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,24 @@ class DailyChangesSheet implements FromCollection, WithHeadings, WithTitle
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return $this->empty ? collect() : DailyChange::myDailyChanges()->withDailyPerformance()->get();
|
||||
if ($this->empty) {
|
||||
return collect();
|
||||
}
|
||||
|
||||
return DailyChange::myDailyChanges()
|
||||
->withDailyPerformance()
|
||||
->get()
|
||||
->map(function ($daily_change) {
|
||||
return [
|
||||
'date' => date_format($daily_change->date, 'Y-m-d'),
|
||||
'portfolio_id' => $daily_change->portfolio_id,
|
||||
'total_market_value' => $daily_change->total_market_value,
|
||||
'total_cost_basis' => $daily_change->total_cost_basis,
|
||||
'realized_gains' => $daily_change->realized_gain_dollars,
|
||||
'total_dividends_earned' => $daily_change->total_dividends_earned,
|
||||
'annotation' => $daily_change->annotation,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function title(): string
|
||||
|
||||
@@ -58,7 +58,7 @@ class TransactionsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
'currency' => $transaction->market_data_currency,
|
||||
'split' => $transaction->split,
|
||||
'reinvested_dividend' => $transaction->reinvested_dividend,
|
||||
'date' => $transaction->date,
|
||||
'date' => date_format($transaction->date, 'Y-m-d'),
|
||||
'created_at' => $transaction->created_at,
|
||||
'updated_at' => $transaction->updated_at,
|
||||
];
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class ApiTokenController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the user API token screen.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('api.index', [
|
||||
'request' => $request,
|
||||
'user' => $request->user(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ class ConnectedAccountController extends Controller
|
||||
'title' => __('Your :provider account has been connected.', ['provider' => config("services.{$connected_account->provider}.name")]),
|
||||
'description' => null,
|
||||
'css' => 'alert-success',
|
||||
'icon' => Blade::render("<x-mary-icon class='w-7 h-7' name='o-check-circle' />"),
|
||||
'icon' => Blade::render("<x-ui.icon class='w-7 h-7' name='o-check-circle' />"),
|
||||
'position' => 'toast-top toast-end',
|
||||
'timeout' => '5000',
|
||||
],
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Traits\HasLocalizedMarkdown;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class PrivacyPolicyController extends Controller
|
||||
{
|
||||
use HasLocalizedMarkdown;
|
||||
|
||||
/**
|
||||
* Show the privacy policy for the application.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
$policyFile = $this->localizedMarkdownPath('policy.md');
|
||||
|
||||
return view('policy', [
|
||||
'policy' => Str::markdown(file_get_contents($policyFile)),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Traits\HasLocalizedMarkdown;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class TermsOfServiceController extends Controller
|
||||
{
|
||||
use HasLocalizedMarkdown;
|
||||
|
||||
/**
|
||||
* Show the terms of service for the application.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
$termsFile = $this->localizedMarkdownPath('terms.md');
|
||||
|
||||
return view('terms', [
|
||||
'terms' => Str::markdown(file_get_contents($termsFile)),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class UserProfileController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the user profile screen.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
return view('profile.show', [
|
||||
'request' => $request,
|
||||
'user' => $request->user(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,8 @@ class TransactionRequest extends FormRequest
|
||||
$this->input('portfolio'),
|
||||
$this->requestOrModelValue('symbol', 'transaction'),
|
||||
$this->requestOrModelValue('transaction_type', 'transaction'),
|
||||
$this->requestOrModelValue('date', 'transaction')
|
||||
$this->requestOrModelValue('date', 'transaction'),
|
||||
$this->transaction
|
||||
),
|
||||
],
|
||||
'currency' => ['required', 'exists:currencies,currency'],
|
||||
|
||||
@@ -27,7 +27,7 @@ class TransactionResource extends JsonResource
|
||||
'sale_price' => $this->sale_price,
|
||||
'split' => $this->split,
|
||||
'reinvested_dividend' => $this->reinvested_dividend,
|
||||
'date' => $this->date,
|
||||
'date' => date_format($this->date, 'Y-m-d'),
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
|
||||
@@ -8,11 +8,13 @@ use App\Interfaces\MarketData\Types\Dividend;
|
||||
use App\Interfaces\MarketData\Types\Ohlc;
|
||||
use App\Interfaces\MarketData\Types\Quote;
|
||||
use App\Interfaces\MarketData\Types\Split;
|
||||
use Carbon\CarbonInterval;
|
||||
use Illuminate\Http\Client\PendingRequest;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class AlpacaMarketData implements MarketDataInterface
|
||||
{
|
||||
@@ -23,6 +25,11 @@ class AlpacaMarketData implements MarketDataInterface
|
||||
public string $apiBaseUrl = 'https://api.alpaca.markets/';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->createNewClient();
|
||||
}
|
||||
|
||||
private function createNewClient()
|
||||
{
|
||||
$this->client = Http::withOptions([
|
||||
'headers' => [
|
||||
@@ -45,15 +52,15 @@ class AlpacaMarketData implements MarketDataInterface
|
||||
|
||||
$quote = $response->json('trade');
|
||||
|
||||
if (is_null(Arr::get($quote, 'p'))) {
|
||||
throw new \Exception('Could not find ticker on Alpaca');
|
||||
}
|
||||
throw_if(empty(Arr::get($quote, 'p')), NotFoundHttpException::class, "Symbol `{$symbol}` was not found");
|
||||
|
||||
$fundamental = cache()->remember(
|
||||
'ap-symbol-'.$symbol,
|
||||
1440,
|
||||
function () use ($symbol) {
|
||||
|
||||
$this->createNewClient();
|
||||
|
||||
$basic = $this->client->baseUrl($this->apiBaseUrl)->get("v2/assets/{$symbol}")->json();
|
||||
$fifty_two_week = $this->client->baseUrl($this->dataBaseUrl)->withQueryParameters([
|
||||
'timeframe' => '12M',
|
||||
@@ -125,24 +132,49 @@ class AlpacaMarketData implements MarketDataInterface
|
||||
|
||||
public function history(string $symbol, $startDate, $endDate): Collection
|
||||
{
|
||||
$response = $this->client->baseUrl($this->dataBaseUrl)->withQueryParameters([
|
||||
'timeframe' => '1D',
|
||||
'start' => Carbon::parse($startDate)->format('Y-m-d'),
|
||||
'end' => Carbon::parse($endDate)->subHours(36)->format('Y-m-d'), // todo: can't query recent SIP data
|
||||
])->get("v2/stocks/{$symbol}/bars");
|
||||
$startDate = Carbon::parse($startDate);
|
||||
$endDate = Carbon::parse($endDate)->subHours(36); // alpaca has sip data limits
|
||||
|
||||
$history = $response->json('bars');
|
||||
$allHistory = collect();
|
||||
|
||||
return collect($history)
|
||||
->map(function ($history) use ($symbol) {
|
||||
$chunks = 1000;
|
||||
|
||||
$date = Carbon::parse($history['t'])->format('Y-m-d');
|
||||
$period = CarbonInterval::days($chunks)->toPeriod($startDate, $endDate);
|
||||
foreach ($period as $startDate) {
|
||||
|
||||
return [$date => new Ohlc([
|
||||
'symbol' => $symbol,
|
||||
'date' => $date,
|
||||
'close' => Arr::get($history, 'c'),
|
||||
])];
|
||||
});
|
||||
$chunkEnd = $startDate->copy()->addDays($chunks - 1);
|
||||
|
||||
if ($chunkEnd->gt($endDate)) {
|
||||
$chunkEnd = $endDate;
|
||||
}
|
||||
|
||||
$this->createNewClient();
|
||||
|
||||
$response = $this->client->baseUrl($this->dataBaseUrl)->withQueryParameters([
|
||||
'timeframe' => '1D',
|
||||
'start' => $startDate->format('Y-m-d'),
|
||||
'end' => $chunkEnd->format('Y-m-d'),
|
||||
])->get("v2/stocks/{$symbol}/bars");
|
||||
|
||||
$history = $response->json('bars');
|
||||
|
||||
throw_if(empty($history), NotFoundHttpException::class, "Symbol `{$symbol}` was not found");
|
||||
|
||||
$chunkedHistory = collect($history)
|
||||
->mapWithKeys(function ($history) use ($symbol) {
|
||||
|
||||
$date = Carbon::parse($history['t'])->format('Y-m-d');
|
||||
|
||||
return [$date => new Ohlc([
|
||||
'symbol' => $symbol,
|
||||
'date' => $date,
|
||||
'close' => Arr::get($history, 'c'),
|
||||
])];
|
||||
});
|
||||
|
||||
$allHistory = $allHistory->merge($chunkedHistory);
|
||||
}
|
||||
|
||||
return $allHistory;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ class AlphaVantageMarketData implements MarketDataInterface
|
||||
return new Dividend([
|
||||
'symbol' => $symbol,
|
||||
'date' => Carbon::parse(Arr::get($dividend, 'ex_dividend_date')),
|
||||
'dividend_amount' => Arr::get($dividend, 'amount'),
|
||||
'dividend_amount' => (float) Arr::get($dividend, 'amount'),
|
||||
]);
|
||||
});
|
||||
}
|
||||
@@ -121,7 +121,7 @@ class AlphaVantageMarketData implements MarketDataInterface
|
||||
return new Split([
|
||||
'symbol' => $symbol,
|
||||
'date' => Carbon::parse(Arr::get($split, 'effective_date')),
|
||||
'split_amount' => Arr::get($split, 'split_factor'),
|
||||
'split_amount' => (float) Arr::get($split, 'split_factor'),
|
||||
]);
|
||||
});
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class AlphaVantageMarketData implements MarketDataInterface
|
||||
return [$date => new Ohlc([
|
||||
'symbol' => $symbol,
|
||||
'date' => $date,
|
||||
'close' => Arr::get($history, '4. close'),
|
||||
'close' => (float) Arr::get($history, '4. close'),
|
||||
])];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class TwelveDataMarketData implements MarketDataInterface
|
||||
{
|
||||
@@ -53,9 +54,7 @@ class TwelveDataMarketData implements MarketDataInterface
|
||||
|
||||
$quote = $response->json();
|
||||
|
||||
if (! isset($quote['price'])) {
|
||||
throw new \Exception('Could not find ticker on Twelve Data');
|
||||
}
|
||||
throw_if(empty(Arr::get($quote, 'price')), NotFoundHttpException::class, "Symbol `{$symbol}` was not found");
|
||||
|
||||
$current_market_value = Arr::get($quote, 'price');
|
||||
|
||||
@@ -152,9 +151,11 @@ class TwelveDataMarketData implements MarketDataInterface
|
||||
])
|
||||
->get('time_series');
|
||||
|
||||
$values = $response->json('values');
|
||||
$history = $response->json('values');
|
||||
|
||||
return collect($values)
|
||||
throw_if(empty($history), NotFoundHttpException::class, "Symbol `{$symbol}` was not found");
|
||||
|
||||
return collect($history)
|
||||
->mapWithKeys(function ($history) use ($symbol) {
|
||||
|
||||
$date = Carbon::parse(Arr::get($history, 'datetime'))->toDateString();
|
||||
|
||||
@@ -38,6 +38,14 @@ class Quote extends MarketDataType
|
||||
|
||||
public function setCurrency(string $currency): self
|
||||
{
|
||||
// need to standardize to ISO 4217
|
||||
$currency = match ($currency) {
|
||||
'US' => 'USD',
|
||||
'CA' => 'CAD',
|
||||
'GBp' => 'GBX',
|
||||
default => $currency
|
||||
};
|
||||
|
||||
$this->items['currency'] = strtoupper((string) $currency);
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Livewire\Tables;
|
||||
|
||||
use App\Models\Holding;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Support\Contracts\TranslatableContentDriver;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\Number;
|
||||
use Livewire\Component;
|
||||
|
||||
class HoldingsTable extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
use InteractsWithActions;
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
public $portfolio;
|
||||
|
||||
public function makeFilamentTranslatableContentDriver(): ?TranslatableContentDriver
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
|
||||
return $table
|
||||
->query(
|
||||
Holding::query()
|
||||
->portfolio($this->portfolio->id)
|
||||
->withMarketData()
|
||||
->withCount(['transactions as num_transactions' => function ($query) {
|
||||
return $query->whereRaw('transactions.symbol = holdings.symbol');
|
||||
}])
|
||||
->withPerformance()
|
||||
)
|
||||
->defaultSort('symbol', 'asc')
|
||||
->paginated(false)
|
||||
->recordUrl(fn ($record) => route('holding.show', ['portfolio' => $record->portfolio_id, 'symbol' => $record->symbol]))
|
||||
->columns([
|
||||
TextColumn::make('symbol')
|
||||
->label(__('Symbol'))
|
||||
->sortable(),
|
||||
TextColumn::make('market_data.name')
|
||||
->label(__('Name'))
|
||||
->sortable(),
|
||||
TextColumn::make('quantity')
|
||||
->label(__('Quantity'))
|
||||
->sortable(),
|
||||
TextColumn::make('average_cost_basis')
|
||||
->label(__('Average Cost Basis'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency)),
|
||||
TextColumn::make('total_cost_basis')
|
||||
->label(__('Total Cost Basis'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency)),
|
||||
TextColumn::make('market_data.market_value')
|
||||
->label(__('Market Value'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency)),
|
||||
TextColumn::make('total_market_value')
|
||||
->label(__('Total Market Value'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency)),
|
||||
TextColumn::make('market_gain_dollars')
|
||||
->label(__('Market Gain/Loss'))
|
||||
->sortable()
|
||||
->html()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency).view('components.ui.gain-loss-arrow-badge', [
|
||||
'costBasis' => $record->average_cost_basis,
|
||||
'marketValue' => $record->market_data?->market_value,
|
||||
'small' => true,
|
||||
])->render()),
|
||||
TextColumn::make('realized_gain_dollars')
|
||||
->label(__('Realized Gain/Loss'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency)),
|
||||
TextColumn::make('dividends_earned')
|
||||
->label(__('Dividends Earned'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency)),
|
||||
TextColumn::make('market_data.fifty_two_week_low')
|
||||
->label(__('52 week low'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency)),
|
||||
TextColumn::make('market_data.fifty_two_week_high')
|
||||
->label(__('52 week high'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data?->currency)),
|
||||
TextColumn::make('num_transactions')
|
||||
->label(__('Number of Transactions'))
|
||||
->sortable(),
|
||||
TextColumn::make('market_data.updated_at')
|
||||
->label(__('Last Refreshed'))
|
||||
->sortable()
|
||||
->since(),
|
||||
])
|
||||
->stackedOnMobile();
|
||||
}
|
||||
|
||||
public function render(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<div>
|
||||
{{ $this->table }}
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Livewire\Tables;
|
||||
|
||||
use App\Models\Transaction;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Support\Contracts\TranslatableContentDriver;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Number;
|
||||
use Livewire\Component;
|
||||
|
||||
class TransactionsTable extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
use InteractsWithActions;
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
public function makeFilamentTranslatableContentDriver(): ?TranslatableContentDriver
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->filters([
|
||||
SelectFilter::make('transaction_type')
|
||||
->options([
|
||||
'BUY' => 'BUY',
|
||||
'SELL' => 'SELL',
|
||||
]),
|
||||
SelectFilter::make('portfolio')
|
||||
->relationship('portfolio', 'title', fn (Builder $query) => $query->myPortfolios())
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
return $query->when(
|
||||
$data['value'],
|
||||
fn (Builder $query, $value) => $query->portfolio($value)
|
||||
);
|
||||
}),
|
||||
])
|
||||
->deferFilters(false)
|
||||
->query(
|
||||
Transaction::query()
|
||||
->with(['portfolio', 'market_data'])
|
||||
->myTransactions()
|
||||
->addSelect(['transactions.*'])
|
||||
->selectRaw('
|
||||
(CASE
|
||||
WHEN transaction_type = \'SELL\'
|
||||
THEN COALESCE(transactions.sale_price, 0)
|
||||
ELSE COALESCE((SELECT market_value FROM market_data WHERE market_data.symbol = transactions.symbol LIMIT 1), 0)
|
||||
END) - COALESCE(transactions.cost_basis, 0) AS gain_dollars')
|
||||
)
|
||||
->defaultSort('date', 'desc')
|
||||
->extremePaginationLinks()
|
||||
->paginated([10])
|
||||
->defaultPaginationPageOption(10)
|
||||
->recordUrl(fn ($record) => route('holding.show', ['portfolio' => $record->portfolio_id, 'symbol' => $record->symbol]))
|
||||
->columns([
|
||||
TextColumn::make('date')
|
||||
->label(__('Date'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state) => Carbon::parse($state)->format('M d, Y')),
|
||||
TextColumn::make('portfolio.title')
|
||||
->label(__('Portfolio'))
|
||||
->sortable(),
|
||||
TextColumn::make('symbol')
|
||||
->label(__('Symbol'))
|
||||
->sortable(),
|
||||
TextColumn::make('market_data.name')
|
||||
->label(__('Name'))
|
||||
->sortable(),
|
||||
TextColumn::make('transaction_type')
|
||||
->label(__('Type'))
|
||||
->sortable()
|
||||
->html()
|
||||
->formatStateUsing(fn ($state, $record) => view('components.ui.badge', [
|
||||
'value' => $record->split ? 'SPLIT' : ($record->reinvested_dividend ? 'REINVEST' : $record->transaction_type),
|
||||
'class' => ($record->transaction_type == 'BUY' ? 'badge-success' : 'badge-error').' badge-sm mr-3',
|
||||
])->render()),
|
||||
TextColumn::make('quantity')
|
||||
->label(__('Quantity'))
|
||||
->sortable(),
|
||||
TextColumn::make('cost_basis')
|
||||
->label(__('Cost Basis'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data->currency)),
|
||||
TextColumn::make('gain_dollars')
|
||||
->label(__('Gain/Loss'))
|
||||
->sortable()
|
||||
->formatStateUsing(fn ($state, $record) => Number::currency($state ?? 0, $record->market_data->currency)),
|
||||
]);
|
||||
}
|
||||
|
||||
public function render(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<div>
|
||||
{{ $this->table }}
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class AgentConversationMessage extends Model
|
||||
{
|
||||
protected $table = 'agent_conversation_messages';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'conversation_id',
|
||||
'user_id',
|
||||
'agent',
|
||||
'role',
|
||||
'content',
|
||||
];
|
||||
|
||||
public function conversation(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ChatWithConversation::class, 'conversation_id');
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AiChat extends Model
|
||||
{
|
||||
use HasUuids;
|
||||
|
||||
protected $fillable = [
|
||||
'role',
|
||||
'content',
|
||||
];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function ($chat) {
|
||||
|
||||
$chat->user_id = auth()->user()->id;
|
||||
});
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function chatable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ChatWithConversation extends Model
|
||||
{
|
||||
protected $table = 'agent_conversations';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'user_id',
|
||||
'title',
|
||||
'chatable_type',
|
||||
'chatable_id',
|
||||
];
|
||||
|
||||
protected static function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function (ChatWithConversation $model) {
|
||||
if (empty($model->id)) {
|
||||
$model->id = (string) Str::uuid7();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function chatable(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
public function messages(): HasMany
|
||||
{
|
||||
return $this->hasMany(AgentConversationMessage::class, 'conversation_id');
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ class DailyChange extends Model
|
||||
->groupBy('portfolio_id', 'date');
|
||||
|
||||
return $query
|
||||
->select(['daily_change.portfolio_id', 'daily_change.date'])
|
||||
->select(['daily_change.date', 'daily_change.portfolio_id'])
|
||||
->selectRaw('daily_change.total_market_value * COALESCE(cr.rate, 1) AS total_market_value')
|
||||
->selectRaw('SUM(COALESCE(ccb.cumulative_cost_basis, 0)) AS total_cost_basis')
|
||||
->selectRaw('daily_change.total_market_value * COALESCE(cr.rate, 1)
|
||||
|
||||
@@ -146,16 +146,19 @@ class Dividend extends Model
|
||||
'dividends.symbol',
|
||||
'dividends.dividend_amount',
|
||||
])->selectRaw("
|
||||
(COALESCE(SUM(CASE WHEN transactions.transaction_type = 'BUY'
|
||||
AND date(transactions.date) <= date(dividends.date)
|
||||
(COALESCE(SUM(CASE WHEN transactions.transaction_type = 'BUY'
|
||||
AND date(transactions.date) <= date(dividends.date)
|
||||
THEN transactions.quantity ELSE 0 END), 0)
|
||||
- COALESCE(SUM(CASE WHEN transactions.transaction_type = 'SELL'
|
||||
AND date(transactions.date) <= date(dividends.date)
|
||||
- COALESCE(SUM(CASE WHEN transactions.transaction_type = 'SELL'
|
||||
AND date(transactions.date) <= date(dividends.date)
|
||||
THEN transactions.quantity ELSE 0 END), 0))
|
||||
* dividends.dividend_amount
|
||||
AS total_received
|
||||
")->join('transactions', 'transactions.symbol', '=', 'dividends.symbol')
|
||||
->join('holdings', 'transactions.portfolio_id', '=', 'holdings.portfolio_id')
|
||||
->join('holdings', function ($join) {
|
||||
$join->on('transactions.portfolio_id', '=', 'holdings.portfolio_id')
|
||||
->on('holdings.symbol', '=', 'dividends.symbol');
|
||||
})
|
||||
->where('dividends.symbol', $symbol)
|
||||
->groupBy('holdings.portfolio_id', 'dividends.date', 'dividends.symbol', 'dividends.dividend_amount', 'dividends.dividend_amount_base');
|
||||
|
||||
|
||||
+8
-10
@@ -8,7 +8,9 @@ use App\Traits\HasMarketData;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -161,14 +163,10 @@ class Holding extends Model
|
||||
->orderBy('date', 'DESC');
|
||||
}
|
||||
|
||||
/**
|
||||
* Related chats for holding
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function chats()
|
||||
public function chatWithConversation(): MorphOne
|
||||
{
|
||||
return $this->morphMany(AiChat::class, 'chatable')->where('user_id', auth()->user()->id);
|
||||
return $this->morphOne(ChatWithConversation::class, 'chatable')
|
||||
->where('user_id', auth()->id());
|
||||
}
|
||||
|
||||
public function scopeWithMarketData($query)
|
||||
@@ -449,7 +447,7 @@ class Holding extends Model
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function qtyOwned(?\Illuminate\Support\Carbon $date = null)
|
||||
public function qtyOwned(?Carbon $date = null)
|
||||
{
|
||||
if ($date == null) {
|
||||
$date = now();
|
||||
@@ -470,8 +468,8 @@ class Holding extends Model
|
||||
* @return void
|
||||
*/
|
||||
public function dailyPerformance(
|
||||
?\Illuminate\Support\Carbon $start_date = null,
|
||||
?\Illuminate\Support\Carbon $end_date = null,
|
||||
?Carbon $start_date = null,
|
||||
?Carbon $end_date = null,
|
||||
) {
|
||||
if ($start_date == null) {
|
||||
$start_date = now();
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use App\Interfaces\MarketData\MarketDataInterface;
|
||||
use App\Models\ChatWithConversation;
|
||||
use App\Notifications\InvitedOnboardingNotification;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
@@ -68,14 +69,10 @@ class Portfolio extends Model
|
||||
return $this->hasMany(DailyChange::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Related chats for portfolio
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function chats()
|
||||
public function chatWithConversation(): \Illuminate\Database\Eloquent\Relations\MorphOne
|
||||
{
|
||||
return $this->morphMany(AiChat::class, 'chatable')->where('user_id', auth()->user()->id);
|
||||
return $this->morphOne(ChatWithConversation::class, 'chatable')
|
||||
->where('user_id', auth()->id());
|
||||
}
|
||||
|
||||
public function scopeMyPortfolios()
|
||||
|
||||
+1
-1
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\HasConnectedAccounts;
|
||||
use App\Traits\HasProfilePhoto;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -12,7 +13,6 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Arr;
|
||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
use Laravel\Jetstream\HasProfilePhoto;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Staudenmeir\EloquentHasManyDeep\HasManyDeep;
|
||||
use Staudenmeir\EloquentHasManyDeep\HasRelationships;
|
||||
|
||||
@@ -4,6 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Interfaces\MarketData\FallbackInterface;
|
||||
use App\Interfaces\MarketData\MarketDataInterface;
|
||||
use Filament\Support\Colors\Color;
|
||||
use Filament\Support\Facades\FilamentColor;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Number;
|
||||
@@ -18,8 +22,8 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->bind(
|
||||
\App\Interfaces\MarketData\MarketDataInterface::class,
|
||||
\App\Interfaces\MarketData\FallbackInterface::class
|
||||
MarketDataInterface::class,
|
||||
FallbackInterface::class
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,6 +32,15 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
FilamentColor::register([
|
||||
'primary' => Color::Stone,
|
||||
'gray' => Color::Zinc,
|
||||
'info' => Color::Blue,
|
||||
'success' => Color::Emerald,
|
||||
'warning' => Color::Amber,
|
||||
'danger' => Color::Red,
|
||||
]);
|
||||
|
||||
JsonResource::withoutWrapping();
|
||||
|
||||
Arr::macro('skipEmptyValues', function (array $array) {
|
||||
|
||||
@@ -30,6 +30,7 @@ class FortifyServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Fortify::viewPrefix('auth.');
|
||||
|
||||
Fortify::createUsersUsing(CreateNewUser::class);
|
||||
Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class);
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Actions\Jetstream\DeleteUser;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Jetstream\Jetstream;
|
||||
|
||||
class JetstreamServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
|
||||
$this->configurePermissions();
|
||||
|
||||
Jetstream::deleteUsersUsing(DeleteUser::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the permissions that are available within the application.
|
||||
*/
|
||||
protected function configurePermissions(): void
|
||||
{
|
||||
Jetstream::defaultApiTokenPermissions([
|
||||
// 'portfolio:read',
|
||||
// 'portfolio:write',
|
||||
// 'holding:read',
|
||||
// 'holding:write',
|
||||
// 'transaction:read',
|
||||
// 'transaction:write',
|
||||
]);
|
||||
|
||||
Jetstream::permissions([
|
||||
// 'Read Portfolios' => 'portfolio:read',
|
||||
// 'Create Portfolios' => 'portfolio:write',
|
||||
// 'Read Holdings' => 'holding:read',
|
||||
// 'Update Holdings' => 'holding:write',
|
||||
// 'Read Transactions' => 'transaction:read',
|
||||
// 'Create Transactions' => 'transaction:write',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Livewire\Volt\Volt;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class VoltServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -21,14 +21,16 @@ class VoltServiceProvider extends ServiceProvider
|
||||
* Bootstrap services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
{
|
||||
Volt::mount([
|
||||
// config('livewire.view_path', resource_path('views/livewire')),
|
||||
resource_path('views/components'),
|
||||
resource_path('views/profile'),
|
||||
resource_path('views/api'),
|
||||
resource_path('views/holding'),
|
||||
resource_path('views/transaction'),
|
||||
resource_path('views/portfolio'),
|
||||
resource_path('views/import-export'),
|
||||
resource_path('views/auth'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace App\Rules;
|
||||
|
||||
use App\Models\Portfolio;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class QuantityValidationRule implements ValidationRule
|
||||
{
|
||||
@@ -20,8 +20,9 @@ class QuantityValidationRule implements ValidationRule
|
||||
protected ?Portfolio $portfolio,
|
||||
protected ?string $symbol,
|
||||
protected ?string $transactionType,
|
||||
protected string|Carbon|null $date
|
||||
) { }
|
||||
protected string|Carbon|null $date,
|
||||
protected ?Transaction $transaction
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Validate the attribute.
|
||||
@@ -42,6 +43,7 @@ class QuantityValidationRule implements ValidationRule
|
||||
->sum('quantity');
|
||||
|
||||
$sales_qty = (float) $this->portfolio->transactions()
|
||||
->where('id', '!=', $this->transaction?->id)
|
||||
->symbol($this->symbol)
|
||||
->sell()
|
||||
->whereDate('date', '<', $this->date)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\Currency;
|
||||
|
||||
if (! function_exists('currency')) {
|
||||
|
||||
// /**
|
||||
// * Returns an instance of the currency model
|
||||
// * */
|
||||
// function currency(): Currency
|
||||
// {
|
||||
// return new Currency;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Contracts\Auth\StatefulGuard;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Laravel\Fortify\Actions\ConfirmPassword;
|
||||
|
||||
trait ConfirmsPasswords
|
||||
{
|
||||
/**
|
||||
* Indicates if the user's password is being confirmed.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $confirmingPassword = false;
|
||||
|
||||
/**
|
||||
* The ID of the operation being confirmed.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $confirmableId = null;
|
||||
|
||||
/**
|
||||
* The user's password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $confirmablePassword = '';
|
||||
|
||||
/**
|
||||
* Start confirming the user's password.
|
||||
*
|
||||
* @param string $confirmableId
|
||||
* @return void
|
||||
*/
|
||||
public function startConfirmingPassword(string $confirmableId)
|
||||
{
|
||||
$this->resetErrorBag();
|
||||
|
||||
if ($this->passwordIsConfirmed()) {
|
||||
return $this->dispatch('password-confirmed',
|
||||
id: $confirmableId,
|
||||
);
|
||||
}
|
||||
|
||||
$this->confirmingPassword = true;
|
||||
$this->confirmableId = $confirmableId;
|
||||
$this->confirmablePassword = '';
|
||||
|
||||
$this->dispatch('confirming-password');
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop confirming the user's password.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function stopConfirmingPassword()
|
||||
{
|
||||
$this->confirmingPassword = false;
|
||||
$this->confirmableId = null;
|
||||
$this->confirmablePassword = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm the user's password.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function confirmPassword()
|
||||
{
|
||||
if (! app(ConfirmPassword::class)(app(StatefulGuard::class), Auth::user(), $this->confirmablePassword)) {
|
||||
throw ValidationException::withMessages([
|
||||
'confirmable_password' => [__('This password does not match our records.')],
|
||||
]);
|
||||
}
|
||||
|
||||
session(['auth.password_confirmed_at' => time()]);
|
||||
|
||||
$this->dispatch('password-confirmed',
|
||||
id: $this->confirmableId,
|
||||
);
|
||||
|
||||
$this->stopConfirmingPassword();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the user's password has been recently confirmed.
|
||||
*
|
||||
* @param int|null $maximumSecondsSinceConfirmation
|
||||
* @return void
|
||||
*/
|
||||
protected function ensurePasswordIsConfirmed($maximumSecondsSinceConfirmation = null)
|
||||
{
|
||||
$maximumSecondsSinceConfirmation = $maximumSecondsSinceConfirmation ?: config('auth.password_timeout', 900);
|
||||
|
||||
$this->passwordIsConfirmed($maximumSecondsSinceConfirmation) ? null : abort(403);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user's password has been recently confirmed.
|
||||
*
|
||||
* @param int|null $maximumSecondsSinceConfirmation
|
||||
* @return bool
|
||||
*/
|
||||
protected function passwordIsConfirmed($maximumSecondsSinceConfirmation = null)
|
||||
{
|
||||
$maximumSecondsSinceConfirmation = $maximumSecondsSinceConfirmation ?: config('auth.password_timeout', 900);
|
||||
|
||||
return (time() - session('auth.password_confirmed_at', 0)) < $maximumSecondsSinceConfirmation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
trait HasLocalizedMarkdown
|
||||
{
|
||||
public function localizedMarkdownPath($name)
|
||||
{
|
||||
$localName = preg_replace('#(\.md)$#i', '.'.app()->getLocale().'$1', $name);
|
||||
|
||||
return Arr::first([
|
||||
resource_path('markdown/'.$localName),
|
||||
resource_path('markdown/'.$name),
|
||||
], function ($path) {
|
||||
return file_exists($path);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
trait HasProfilePhoto
|
||||
{
|
||||
/**
|
||||
* Update the user's profile photo.
|
||||
*
|
||||
* @param string $storagePath
|
||||
* @return void
|
||||
*/
|
||||
public function updateProfilePhoto(UploadedFile $photo, $storagePath = 'profile-photos')
|
||||
{
|
||||
tap($this->profile_photo_path, function ($previous) use ($photo, $storagePath) {
|
||||
$this->forceFill([
|
||||
'profile_photo_path' => $photo->storePublicly(
|
||||
$storagePath, ['disk' => $this->profilePhotoDisk()]
|
||||
),
|
||||
])->save();
|
||||
|
||||
if ($previous) {
|
||||
Storage::disk($this->profilePhotoDisk())->delete($previous);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the user's profile photo.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteProfilePhoto()
|
||||
{
|
||||
if (is_null($this->profile_photo_path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Storage::disk($this->profilePhotoDisk())->delete($this->profile_photo_path);
|
||||
|
||||
$this->forceFill([
|
||||
'profile_photo_path' => null,
|
||||
])->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL to the user's profile photo.
|
||||
*/
|
||||
protected function profilePhotoUrl(): Attribute
|
||||
{
|
||||
return Attribute::get(function (): string {
|
||||
return $this->profile_photo_path
|
||||
? Storage::disk($this->profilePhotoDisk())->url($this->profile_photo_path)
|
||||
: $this->defaultProfilePhotoUrl();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default profile photo URL if no profile photo has been uploaded.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function defaultProfilePhotoUrl()
|
||||
{
|
||||
$name = trim(collect(explode(' ', $this->name))->map(function ($segment) {
|
||||
return mb_substr($segment, 0, 1);
|
||||
})->join(' '));
|
||||
|
||||
return 'https://ui-avatars.com/api/?name='.urlencode($name).'&color=7F9CF5&background=EBF4FF';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the disk that profile photos should be stored on.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function profilePhotoDisk()
|
||||
{
|
||||
return config('filesystems.default', 'local');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
|
||||
trait Toast
|
||||
{
|
||||
public function toast(
|
||||
string $type,
|
||||
string $title,
|
||||
?string $description = null,
|
||||
?string $position = null,
|
||||
string $icon = 'o-information-circle',
|
||||
string $css = 'alert-info',
|
||||
int $timeout = 3000,
|
||||
?string $redirectTo = null
|
||||
) {
|
||||
$toast = [
|
||||
'type' => $type,
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'position' => $position,
|
||||
'icon' => Blade::render("<x-ui.icon class='w-7 h-7' name='".$icon."' />"),
|
||||
'css' => $css,
|
||||
'timeout' => $timeout,
|
||||
];
|
||||
|
||||
$this->js('toast('.json_encode(['toast' => $toast]).')');
|
||||
|
||||
if ($redirectTo) {
|
||||
return $this->redirect($redirectTo, navigate: true);
|
||||
}
|
||||
}
|
||||
|
||||
public function success(
|
||||
string $title,
|
||||
?string $description = null,
|
||||
?string $position = null,
|
||||
string $icon = 'o-check-circle',
|
||||
string $css = 'alert-success',
|
||||
int $timeout = 3000,
|
||||
?string $redirectTo = null
|
||||
) {
|
||||
return $this->toast('success', $title, $description, $position, $icon, $css, $timeout, $redirectTo);
|
||||
}
|
||||
|
||||
public function warning(
|
||||
string $title,
|
||||
?string $description = null,
|
||||
?string $position = null,
|
||||
string $icon = 'o-exclamation-triangle',
|
||||
string $css = 'alert-warning',
|
||||
int $timeout = 3000,
|
||||
?string $redirectTo = null
|
||||
) {
|
||||
return $this->toast('warning', $title, $description, $position, $icon, $css, $timeout, $redirectTo);
|
||||
}
|
||||
|
||||
public function error(
|
||||
string $title,
|
||||
?string $description = null,
|
||||
?string $position = null,
|
||||
string $icon = 'o-x-circle',
|
||||
string $css = 'alert-error',
|
||||
int $timeout = 3000,
|
||||
?string $redirectTo = null
|
||||
) {
|
||||
return $this->toast('error', $title, $description, $position, $icon, $css, $timeout, $redirectTo);
|
||||
}
|
||||
|
||||
public function info(
|
||||
string $title,
|
||||
?string $description = null,
|
||||
?string $position = null,
|
||||
string $icon = 'o-information-circle',
|
||||
string $css = 'alert-info',
|
||||
int $timeout = 3000,
|
||||
?string $redirectTo = null
|
||||
) {
|
||||
return $this->toast('info', $title, $description, $position, $icon, $css, $timeout, $redirectTo);
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class AppLayout extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represents the component.
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return <<<'HTML'
|
||||
<x-main-layout>
|
||||
<x-slot:body class="min-h-screen font-sans antialiased bg-base-200/50 dark:bg-base-200" x-data>
|
||||
|
||||
<div>
|
||||
|
||||
<x-partials.nav-bar />
|
||||
|
||||
<x-partials.main with-nav full-width>
|
||||
|
||||
<x-slot:sidebar drawer="main-drawer" class="bg-base-100 lg:bg-inherit">
|
||||
|
||||
@livewire('partials.side-bar')
|
||||
|
||||
</x-slot:sidebar>
|
||||
|
||||
<x-slot:content>
|
||||
|
||||
{{ $slot }}
|
||||
</x-slot:content>
|
||||
|
||||
</x-partials.main>
|
||||
|
||||
@if(session('toast'))
|
||||
<script lang="text/javascript">
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
window.toast(JSON.parse(@json(session('toast'))))
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
<x-toast />
|
||||
</div>
|
||||
|
||||
</x-slot:body>
|
||||
</x-main-layout>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class GuestLayout extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represents the component.
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return <<<'HTML'
|
||||
<x-main-layout>
|
||||
<x-slot:body class="font-sans text-gray-900 dark:text-gray-100 antialiased">
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
<x-theme-toggle class="hidden" darkTheme="business" lightTheme="corporate"/>
|
||||
|
||||
</x-slot:body>
|
||||
</x-main-layout>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class MainLayout extends Component
|
||||
{
|
||||
public function __construct(
|
||||
|
||||
// Slots
|
||||
public mixed $body = null,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represents the component.
|
||||
*/
|
||||
public function render(): View
|
||||
{
|
||||
return view('layouts.main-layout');
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"agents": [
|
||||
"claude_code"
|
||||
],
|
||||
"editors": [
|
||||
"claude_code",
|
||||
"vscode"
|
||||
],
|
||||
"guidelines": [],
|
||||
"herd_mcp": true
|
||||
}
|
||||
@@ -5,6 +5,5 @@ declare(strict_types=1);
|
||||
return [
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\FortifyServiceProvider::class,
|
||||
App\Providers\JetstreamServiceProvider::class,
|
||||
App\Providers\VoltServiceProvider::class,
|
||||
];
|
||||
|
||||
+21
-14
@@ -2,28 +2,36 @@
|
||||
"name": "investbrainapp/investbrain",
|
||||
"type": "project",
|
||||
"description": "A smart open-source tool that consolidates and tracks portfolios from your different brokerages",
|
||||
"keywords": ["stocks", "dividends", "investments", "tracking"],
|
||||
"keywords": [
|
||||
"stocks",
|
||||
"dividends",
|
||||
"investments",
|
||||
"tracking"
|
||||
],
|
||||
"license": "CC-BY-NC 4.0",
|
||||
"require": {
|
||||
"php": "^8.3",
|
||||
"ext-gd": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-zip": "*",
|
||||
"blade-ui-kit/blade-heroicons": "^2.6",
|
||||
"filament/tables": "^5.0",
|
||||
"finnhub/client": "master@dev",
|
||||
"hackeresq/filter-models": "dev-main",
|
||||
"investbrainapp/frankfurter-client": "dev-main",
|
||||
"laravel/framework": "^11.35",
|
||||
"laravel/jetstream": "^5.1",
|
||||
"laravel/ai": "^0.2.5",
|
||||
"laravel/fortify": "^1.30.0",
|
||||
"laravel/framework": "^13.0",
|
||||
"laravel/sanctum": "^4.0",
|
||||
"laravel/socialite": "^5.16",
|
||||
"laravel/tinker": "^2.9",
|
||||
"laravel/tinker": "^3.0",
|
||||
"league/flysystem-aws-s3-v3": "^3.0",
|
||||
"livewire/livewire": "^3.5",
|
||||
"livewire/livewire": "^4.0",
|
||||
"livewire/volt": "^1.6",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"openai-php/client": "^0.10.3",
|
||||
"predis/predis": "^2.2",
|
||||
"robsontenorio/mary": "^1.35",
|
||||
"scheb/yahoo-finance-api": "^5.0",
|
||||
"staudenmeir/eloquent-has-many-deep": "^1.20",
|
||||
"symfony/cache": "^7.3",
|
||||
@@ -31,11 +39,11 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/pint": "^1.13",
|
||||
"laravel/sail": "^1.26",
|
||||
"laravel/boost": "^2.0",
|
||||
"laravel/pint": "^1.25",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.0",
|
||||
"phpunit/phpunit": "^11.0.1"
|
||||
"phpunit/phpunit": "^12.0"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
@@ -55,9 +63,6 @@
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"files": [
|
||||
"app/Support/Helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
@@ -72,10 +77,12 @@
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
"@php artisan package:discover --ansi",
|
||||
"@php artisan filament:upgrade"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi --force",
|
||||
"@php artisan boost:update --ansi; exit 0"
|
||||
],
|
||||
"post-root-package-install": [
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
|
||||
Generated
+2805
-1741
File diff suppressed because it is too large
Load Diff
+137
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default AI Provider Names
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the AI providers below should be the
|
||||
| default for AI operations when no explicit provider is provided
|
||||
| for the operation. This should be any provider defined below.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CHAT_PROVIDER', 'openai'),
|
||||
'default_for_images' => 'gemini',
|
||||
'default_for_audio' => 'openai',
|
||||
'default_for_transcription' => 'openai',
|
||||
'default_for_embeddings' => 'openai',
|
||||
'default_for_reranking' => 'cohere',
|
||||
|
||||
'models' => [
|
||||
'text' => [
|
||||
'default' => env('CHAT_MODEL', null),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Caching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below you may configure caching strategies for AI related operations
|
||||
| such as embedding generation. You are free to adjust these values
|
||||
| based on your application's available caching stores and needs.
|
||||
|
|
||||
*/
|
||||
|
||||
'caching' => [
|
||||
'embeddings' => [
|
||||
'cache' => false,
|
||||
'store' => env('CACHE_STORE', 'database'),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| AI Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below are each of your AI providers defined for this application. Each
|
||||
| represents an AI provider and API key combination which can be used
|
||||
| to perform tasks like text, image, and audio creation via agents.
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
'anthropic' => [
|
||||
'driver' => 'anthropic',
|
||||
'key' => env('ANTHROPIC_API_KEY'),
|
||||
],
|
||||
|
||||
'azure' => [
|
||||
'driver' => 'azure',
|
||||
'key' => env('AZURE_OPENAI_API_KEY'),
|
||||
'url' => env('AZURE_OPENAI_URL'),
|
||||
'api_version' => env('AZURE_OPENAI_API_VERSION', '2024-10-21'),
|
||||
'deployment' => env('AZURE_OPENAI_DEPLOYMENT', 'gpt-4o'),
|
||||
'embedding_deployment' => env('AZURE_OPENAI_EMBEDDING_DEPLOYMENT', 'text-embedding-3-small'),
|
||||
],
|
||||
|
||||
'cohere' => [
|
||||
'driver' => 'cohere',
|
||||
'key' => env('COHERE_API_KEY'),
|
||||
],
|
||||
|
||||
'deepseek' => [
|
||||
'driver' => 'deepseek',
|
||||
'key' => env('DEEPSEEK_API_KEY'),
|
||||
],
|
||||
|
||||
'eleven' => [
|
||||
'driver' => 'eleven',
|
||||
'key' => env('ELEVENLABS_API_KEY'),
|
||||
],
|
||||
|
||||
'gemini' => [
|
||||
'driver' => 'gemini',
|
||||
'key' => env('GEMINI_API_KEY'),
|
||||
],
|
||||
|
||||
'groq' => [
|
||||
'driver' => 'groq',
|
||||
'key' => env('GROQ_API_KEY'),
|
||||
],
|
||||
|
||||
'jina' => [
|
||||
'driver' => 'jina',
|
||||
'key' => env('JINA_API_KEY'),
|
||||
],
|
||||
|
||||
'mistral' => [
|
||||
'driver' => 'mistral',
|
||||
'key' => env('MISTRAL_API_KEY'),
|
||||
],
|
||||
|
||||
'ollama' => [
|
||||
'driver' => 'ollama',
|
||||
'key' => env('OLLAMA_API_KEY', ''),
|
||||
'url' => env('OLLAMA_BASE_URL', 'http://localhost:11434'),
|
||||
],
|
||||
|
||||
'openai' => [
|
||||
'driver' => 'openai',
|
||||
'key' => env('OPENAI_API_KEY'),
|
||||
],
|
||||
|
||||
'openrouter' => [
|
||||
'driver' => 'openrouter',
|
||||
'key' => env('OPENROUTER_API_KEY'),
|
||||
],
|
||||
|
||||
'voyageai' => [
|
||||
'driver' => 'voyageai',
|
||||
'key' => env('VOYAGEAI_API_KEY'),
|
||||
],
|
||||
|
||||
'xai' => [
|
||||
'driver' => 'xai',
|
||||
'key' => env('XAI_API_KEY'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
@@ -151,6 +151,16 @@ return [
|
||||
'label' => 'English (United States)',
|
||||
'flag' => '',
|
||||
],
|
||||
[
|
||||
'locale' => 'fr_CA',
|
||||
'label' => 'French (Canada)',
|
||||
'flag' => '',
|
||||
],
|
||||
[
|
||||
'locale' => 'fr_FR',
|
||||
'label' => 'French (France)',
|
||||
'flag' => '',
|
||||
],
|
||||
[
|
||||
'locale' => 'es_419',
|
||||
'label' => 'Spanish (Latin America)',
|
||||
|
||||
@@ -107,4 +107,17 @@ return [
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Serializable Classes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| For security, unserialization of cached PHP objects is restricted. Set
|
||||
| this to false to disallow all object unserialization, or list the
|
||||
| specific classes your application intentionally caches as objects.
|
||||
|
|
||||
*/
|
||||
|
||||
'serializable_classes' => false,
|
||||
|
||||
];
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Laravel\Jetstream\Features;
|
||||
use Laravel\Jetstream\Http\Middleware\AuthenticateSession;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Jetstream Stack
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This configuration value informs Jetstream which "stack" you will be
|
||||
| using for your application. In general, this value is set for you
|
||||
| during installation and will not need to be changed after that.
|
||||
|
|
||||
*/
|
||||
|
||||
'stack' => 'livewire',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Jetstream Route Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which middleware Jetstream will assign to the routes
|
||||
| that it registers with the application. When necessary, you may modify
|
||||
| these middleware; however, this default value is usually sufficient.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => ['web'],
|
||||
|
||||
'auth_session' => AuthenticateSession::class,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Jetstream Guard
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the authentication guard Jetstream will use while
|
||||
| authenticating users. This value should correspond with one of your
|
||||
| guards that is already present in your "auth" configuration file.
|
||||
|
|
||||
*/
|
||||
|
||||
'guard' => 'sanctum',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Features
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some of Jetstream's features are optional. You may disable the features
|
||||
| by removing them from this array. You're free to only remove some of
|
||||
| these features or you can even remove all of these if you need to.
|
||||
|
|
||||
*/
|
||||
|
||||
'features' => [
|
||||
Features::profilePhotos(),
|
||||
Features::api(),
|
||||
Features::accountDeletion(),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Profile Photo Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This configuration value determines the default disk that will be used
|
||||
| when storing profile photos for your application's users. Typically
|
||||
| this will be the "public" disk but you may adjust this if needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'profile_photo_disk' => env('JETSTREAM_PROFILE_PHOTO_DISK', 'public'),
|
||||
|
||||
];
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
|
||||
'theme' => 'tailwind',
|
||||
|
||||
/**
|
||||
* Enable or Disable automatic injection of core assets
|
||||
*/
|
||||
'inject_core_assets_enabled' => false,
|
||||
|
||||
/**
|
||||
* Enable or Disable automatic injection of third-party assets
|
||||
*/
|
||||
'inject_third_party_assets_enabled' => false,
|
||||
|
||||
/**
|
||||
* Enable Blade Directives (Not required if automatically injecting or using bundler approaches)
|
||||
*/
|
||||
'enable_blade_directives ' => false,
|
||||
|
||||
];
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
/**
|
||||
* Default component prefix.
|
||||
*
|
||||
* Make sure to clear view cache after renaming with `php artisan view:clear`
|
||||
*
|
||||
* prefix => ''
|
||||
* <x-button />
|
||||
* <x-card />
|
||||
*
|
||||
* prefix => 'mary-'
|
||||
* <x-mary-button />
|
||||
* <x-mary-card />
|
||||
*/
|
||||
'prefix' => '',
|
||||
|
||||
/**
|
||||
* Default route prefix.
|
||||
*
|
||||
* Some maryUI components make network request to its internal routes.
|
||||
*
|
||||
* route_prefix => ''
|
||||
* - Spotlight: '/mary/spotlight'
|
||||
* - Editor: '/mary/upload'
|
||||
* - ...
|
||||
*
|
||||
* route_prefix => 'my-components'
|
||||
* - Spotlight: '/my-components/mary/spotlight'
|
||||
* - Editor: '/my-components/mary/upload'
|
||||
* - ...
|
||||
*/
|
||||
'route_prefix' => '',
|
||||
|
||||
/**
|
||||
* Components settings
|
||||
*/
|
||||
'components' => [
|
||||
'spotlight' => [
|
||||
'class' => 'App\Support\Spotlight',
|
||||
],
|
||||
],
|
||||
];
|
||||
+6
-3
@@ -2,6 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||
use Illuminate\Foundation\Http\Middleware\PreventRequestForgery;
|
||||
use Laravel\Sanctum\Http\Middleware\AuthenticateSession;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
return [
|
||||
@@ -77,9 +80,9 @@ return [
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
|
||||
'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
|
||||
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
|
||||
'authenticate_session' => AuthenticateSession::class,
|
||||
'encrypt_cookies' => EncryptCookies::class,
|
||||
'validate_csrf_token' => PreventRequestForgery::class,
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -122,19 +122,21 @@ class TransactionFactory extends Factory
|
||||
]);
|
||||
}
|
||||
|
||||
public function buy(): static
|
||||
public function buy($quantity = 1): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'transaction_type' => 'BUY',
|
||||
'quantity' => $quantity,
|
||||
'cost_basis' => $this->faker->randomFloat(2, 10, 500),
|
||||
'sale_price' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
public function sell(): static
|
||||
public function sell($quantity = 1): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'transaction_type' => 'SELL',
|
||||
'quantity' => $quantity,
|
||||
'sale_price' => $this->faker->randomFloat(2, 10, 500),
|
||||
'cost_basis' => null,
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Laravel\Ai\Migrations\AiMigration;
|
||||
|
||||
return new class extends AiMigration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('agent_conversations', function (Blueprint $table) {
|
||||
$table->string('id', 36)->primary();
|
||||
$table->foreignIdFor(User::class, 'user_id')->constrained()->onDelete('cascade')->nullable();
|
||||
$table->string('title');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['user_id', 'updated_at']);
|
||||
});
|
||||
|
||||
Schema::create('agent_conversation_messages', function (Blueprint $table) {
|
||||
$table->string('id', 36)->primary();
|
||||
$table->string('conversation_id', 36)->index();
|
||||
$table->foreignIdFor(User::class, 'user_id')->constrained()->onDelete('cascade')->nullable();
|
||||
$table->string('agent');
|
||||
$table->string('role', 25);
|
||||
$table->text('content');
|
||||
$table->text('attachments');
|
||||
$table->text('tool_calls');
|
||||
$table->text('tool_results');
|
||||
$table->text('usage');
|
||||
$table->text('meta');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['conversation_id', 'user_id', 'updated_at'], 'conversation_index');
|
||||
$table->index(['user_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('agent_conversations');
|
||||
Schema::dropIfExists('agent_conversation_messages');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('agent_conversations', function (Blueprint $table) {
|
||||
$table->nullableUuidMorphs('chatable');
|
||||
$table->unique(['user_id', 'chatable_type', 'chatable_id'], 'chat_with_unique');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('agent_conversations', function (Blueprint $table) {
|
||||
$table->dropUnique('chat_with_unique');
|
||||
$table->dropMorphs('chatable');
|
||||
});
|
||||
}
|
||||
};
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
# Stage 1: Build stage
|
||||
FROM php:8.3-fpm AS builder
|
||||
FROM php:8.4-fpm AS builder
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV APP_NAME=Investbrain
|
||||
@@ -27,7 +27,7 @@ RUN apt-get update && apt-get upgrade -y \
|
||||
|
||||
# Install PHP extensions
|
||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j$(nproc) gd zip
|
||||
&& docker-php-ext-install -j$(nproc) gd zip intl
|
||||
|
||||
# Copy application files
|
||||
COPY . .
|
||||
@@ -39,7 +39,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
|
||||
&& rm -rf node_modules
|
||||
|
||||
# Stage 2: Production stage
|
||||
FROM php:8.3-fpm-alpine
|
||||
FROM php:8.4-fpm-alpine
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /var/app
|
||||
@@ -71,8 +71,8 @@ RUN apk add --no-cache \
|
||||
RUN rm -rf /var/www/html \
|
||||
&& ln -s /var/app /var/www/app
|
||||
|
||||
# Create required directories for supervisord
|
||||
RUN mkdir -p /var/log/supervisor /var/run/supervisor
|
||||
# Create required directories
|
||||
RUN mkdir -p /var/log/supervisor /var/run/supervisor /var/run/nginx
|
||||
|
||||
# Copy over configs
|
||||
COPY ./docker/nginx.conf /etc/nginx/http.d/default.conf
|
||||
|
||||
@@ -15,6 +15,9 @@ mkdir -p storage/framework/cache \
|
||||
storage/app \
|
||||
storage/logs
|
||||
|
||||
timestamp=$(date -u "+[%Y-%m-%d %H:%M:%S]")
|
||||
echo "$timestamp Investbrain starting ($VERSION)..." >> storage/logs/laravel.log
|
||||
|
||||
echo -e "\n > Storage directory scaffolding is OK... "
|
||||
|
||||
# Ensure storage directory is permissioned for www-data
|
||||
|
||||
+12
-15
@@ -15,6 +15,7 @@
|
||||
"Cancel": "Cancel",
|
||||
"Save": "Save",
|
||||
"Close": "Close",
|
||||
"Dismiss": "Dismiss",
|
||||
"or": "or",
|
||||
"and": "and",
|
||||
"Yes": "Yes",
|
||||
@@ -28,21 +29,14 @@
|
||||
"Permanently delete your account.": "Permanently delete your account.",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.": "Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.",
|
||||
"Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.": "Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.",
|
||||
"Browser Sessions": "Browser Sessions",
|
||||
"Manage and log out your active sessions on other browsers and devices.": "Manage and log out your active sessions on other browsers and devices.",
|
||||
"If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.": "If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.",
|
||||
"This device": "This device",
|
||||
"Last active": "Last active",
|
||||
"Log Out Other Browser Sessions": "Log Out Other Browser Sessions",
|
||||
"Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices.": "Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices.",
|
||||
"Two Factor Authentication": "Two Factor Authentication",
|
||||
"Add additional security to your account using two factor authentication.": "Add additional security to your account using two factor authentication.",
|
||||
"Finish enabling two factor authentication.": "Finish enabling two factor authentication.",
|
||||
"You have enabled two factor authentication.": "You have enabled two factor authentication.",
|
||||
"You have not enabled two factor authentication.": "You have not enabled two factor authentication.",
|
||||
"When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone\\'s Google Authenticator application.": "When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone\\'s Google Authenticator application.",
|
||||
"To finish enabling two factor authentication, scan the following QR code using your phone\\'s authenticator application or enter the setup key and provide the generated OTP code.": "To finish enabling two factor authentication, scan the following QR code using your phone\\'s authenticator application or enter the setup key and provide the generated OTP code.",
|
||||
"Two factor authentication is now enabled. Scan the following QR code using your phone\\'s authenticator application or enter the setup key.": "Two factor authentication is now enabled. Scan the following QR code using your phone\\'s authenticator application or enter the setup key.",
|
||||
"When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone's Google Authenticator application.": "When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone's Google Authenticator application.",
|
||||
"To finish enabling two factor authentication, scan the following QR code using your phone's authenticator application or enter the setup key and provide the generated OTP code.": "To finish enabling two factor authentication, scan the following QR code using your phone's authenticator application or enter the setup key and provide the generated OTP code.",
|
||||
"Two factor authentication is now enabled. Scan the following QR code using your phone's authenticator application or enter the setup key.": "Two factor authentication is now enabled. Scan the following QR code using your phone's authenticator application or enter the setup key.",
|
||||
"Setup Key": "Setup Key",
|
||||
"Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.": "Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.",
|
||||
"Regenerate Recovery Codes": "Regenerate Recovery Codes",
|
||||
@@ -57,7 +51,7 @@
|
||||
"Your :provider account has been connected.": "Your :provider account has been connected.",
|
||||
"Account already exists. Check your email to connect your :provider account.": "Account already exists. Check your email to connect your :provider account.",
|
||||
"Could not login using :provider. Try again later.": "Could not login using :provider. Try again later.",
|
||||
"Update your account\\'s profile information and email address.": "Update your account\\'s profile information and email address.",
|
||||
"Update your account's profile information and email address.": "Update your account's profile information and email address.",
|
||||
"Photo": "Photo",
|
||||
"Select A New Photo": "Select A New Photo",
|
||||
"Remove Photo": "Remove Photo",
|
||||
@@ -68,7 +62,9 @@
|
||||
"Last used": "Last used",
|
||||
"Delete": "Delete",
|
||||
"API Token": "API Token",
|
||||
"Please copy your new API token. For your security, it won\\'t be shown again.": "Please copy your new API token. For your security, it won\\'t be shown again.",
|
||||
"Please copy your new API token. For your security, it won't be shown again.": "Please copy your new API token. For your security, it won't be shown again.",
|
||||
"Copy to clipboard": "Copy to clipboard",
|
||||
"Successfully copied!": "Successfully copied!",
|
||||
"API Token Permissions": "API Token Permissions",
|
||||
"API tokens allow third-party services to authenticate with Investbrain on your behalf.": "API tokens allow third-party services to authenticate with Investbrain on your behalf.",
|
||||
"Delete API Token": "Delete API Token",
|
||||
@@ -96,7 +92,7 @@
|
||||
"Recovery Code": "Recovery Code",
|
||||
"Use a recovery code": "Use a recovery code",
|
||||
"Use an authentication code": "Use an authentication code",
|
||||
"Before continuing, could you verify your email address by clicking on the link we just emailed to you? If you didn\\'t receive the email, we will gladly send you another.": "Before continuing, could you verify your email address by clicking on the link we just emailed to you? If you didn\\'t receive the email, we will gladly send you another.",
|
||||
"Before continuing, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.": "Before continuing, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.",
|
||||
"A new verification link has been sent to the email address you provided in your profile settings.": "A new verification link has been sent to the email address you provided in your profile settings.",
|
||||
"Resend Verification Email": "Resend Verification Email",
|
||||
"Edit Profile": "Edit Profile",
|
||||
@@ -114,8 +110,9 @@
|
||||
"The provided password does not match your current password.": "The provided password does not match your current password.",
|
||||
|
||||
"Documentation": "Documentation",
|
||||
"We\\'re open source!": "We\\'re open source!",
|
||||
"We're open source!": "We're open source!",
|
||||
"Toggle Theme": "Toggle Theme",
|
||||
"Toggle Sidebar": "Toggle Sidebar",
|
||||
|
||||
"Dashboard": "Dashboard",
|
||||
"Gain/Loss": "Gain/Loss",
|
||||
@@ -333,7 +330,7 @@
|
||||
"passwords.sent": "We have emailed your password reset link.",
|
||||
"passwords.throttled": "Please wait before retrying.",
|
||||
"passwords.token": "This password reset token is invalid.",
|
||||
"passwords.user": "We can\\'t find a user with that email address.",
|
||||
"passwords.user": "We can't find a user with that email address.",
|
||||
|
||||
"pagination.previous": "« Previous",
|
||||
"pagination.next": "Next »",
|
||||
|
||||
+4
-7
@@ -15,6 +15,7 @@
|
||||
"Cancel": "Cancelar",
|
||||
"Save": "Guardar",
|
||||
"Close": "Cerrar",
|
||||
"Dismiss": "Despedir",
|
||||
"or": "o",
|
||||
"and": "y",
|
||||
"Yes": "Sí",
|
||||
@@ -28,13 +29,6 @@
|
||||
"Permanently delete your account.": "Elimina tu cuenta de forma permanente.",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.": "Una vez que tu cuenta sea eliminada, todos sus recursos y datos serán eliminados de forma permanente. Antes de eliminar tu cuenta, descarga cualquier dato o información que desees conservar.",
|
||||
"Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.": "¿Estás seguro de que deseas eliminar tu cuenta? Una vez que tu cuenta sea eliminada, todos sus recursos y datos serán eliminados de forma permanente. Introduce tu contraseña para confirmar que deseas eliminar tu cuenta de forma permanente.",
|
||||
"Browser Sessions": "Sesiones del Navegador",
|
||||
"Manage and log out your active sessions on other browsers and devices.": "Gestiona y cierra sesión en tus sesiones activas en otros navegadores y dispositivos.",
|
||||
"If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.": "Si es necesario, puedes cerrar sesión en todas tus otras sesiones del navegador en todos tus dispositivos. Algunas de tus sesiones recientes se enumeran a continuación; sin embargo, esta lista puede no ser exhaustiva. Si sientes que tu cuenta ha sido comprometida, también deberías actualizar tu contraseña.",
|
||||
"This device": "Este dispositivo",
|
||||
"Last active": "Última actividad",
|
||||
"Log Out Other Browser Sessions": "Cerrar Sesión en Otras Sesiones del Navegador",
|
||||
"Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices.": "Introduce tu contraseña para confirmar que deseas cerrar sesión en tus otras sesiones del navegador en todos tus dispositivos.",
|
||||
"Two Factor Authentication": "Autenticación de Dos Factores",
|
||||
"Add additional security to your account using two factor authentication.": "Añade seguridad adicional a tu cuenta utilizando autenticación de dos factores.",
|
||||
"Finish enabling two factor authentication.": "Finaliza la activación de la autenticación de dos factores.",
|
||||
@@ -69,6 +63,8 @@
|
||||
"Delete": "Eliminar",
|
||||
"API Token": "Token API",
|
||||
"Please copy your new API token. For your security, it won't be shown again.": "Por favor, copia tu nuevo token API. Por seguridad, no se mostrará nuevamente.",
|
||||
"Copy to clipboard": "Copiar al portapapeles",
|
||||
"Successfully copied!": "Copiado con éxito!",
|
||||
"API Token Permissions": "Permisos del Token API",
|
||||
"API tokens allow third-party services to authenticate with Investbrain on your behalf.": "Los tokens API permiten que servicios de terceros se autentiquen con Investbrain en tu nombre.",
|
||||
"Delete API Token": "Eliminar Token API",
|
||||
@@ -116,6 +112,7 @@
|
||||
"Documentation": "Documentación",
|
||||
"We're open source!": "¡Somos de código abierto!",
|
||||
"Toggle Theme": "Cambiar Tema",
|
||||
"Toggle Sidebar": "Alternar Navegación Lateral",
|
||||
|
||||
"Dashboard": "Tablero",
|
||||
"Gain/Loss": "Ganancia/Pérdida",
|
||||
|
||||
+386
@@ -0,0 +1,386 @@
|
||||
{
|
||||
"Unknown": "Inconnu",
|
||||
"Done.": "Terminé.",
|
||||
"Saved.": "Enregistré.",
|
||||
"Created.": "Créé.",
|
||||
"Enable": "Activer",
|
||||
"Disable": "Désactiver",
|
||||
"Log Out": "Se déconnecter",
|
||||
"Import": "Importer",
|
||||
"Export": "Exporter",
|
||||
"Log in": "Se connecter",
|
||||
"Register": "S'inscrire",
|
||||
"Create": "Créer",
|
||||
"Update": "Mettre à jour",
|
||||
"Cancel": "Annuler",
|
||||
"Save": "Enregistrer",
|
||||
"Close": "Fermer",
|
||||
"Dismiss": "Ignorer",
|
||||
"or": "ou",
|
||||
"and": "et",
|
||||
"Yes": "Oui",
|
||||
"you": "vous",
|
||||
"You": "Vous",
|
||||
"Nothing to show here yet": "Rien à afficher pour l'instant",
|
||||
"Try again": "Réessayer",
|
||||
|
||||
"Hang on! You're doing that too much.": "Attendez ! Vous faites cela trop souvent.",
|
||||
"Delete Account": "Supprimer le compte",
|
||||
"Permanently delete your account.": "Supprimez définitivement votre compte.",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.": "Une fois votre compte supprimé, toutes ses ressources et données seront définitivement supprimées. Avant de supprimer votre compte, veuillez télécharger toutes les données ou informations que vous souhaitez conserver.",
|
||||
"Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.": "Êtes-vous sûr de vouloir supprimer votre compte ? Une fois votre compte supprimé, toutes ses ressources et données seront définitivement supprimées. Veuillez saisir votre mot de passe pour confirmer la suppression définitive de votre compte.",
|
||||
"Two Factor Authentication": "Authentification à deux facteurs",
|
||||
"Add additional security to your account using two factor authentication.": "Ajoutez une sécurité supplémentaire à votre compte grâce à l'authentification à deux facteurs.",
|
||||
"Finish enabling two factor authentication.": "Terminez l'activation de l'authentification à deux facteurs.",
|
||||
"You have enabled two factor authentication.": "Vous avez activé l'authentification à deux facteurs.",
|
||||
"You have not enabled two factor authentication.": "Vous n'avez pas activé l'authentification à deux facteurs.",
|
||||
"When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone's Google Authenticator application.": "Lorsque l'authentification à deux facteurs est activée, un jeton sécurisé et aléatoire vous sera demandé lors de la connexion. Vous pouvez récupérer ce jeton depuis l'application Google Authenticator de votre téléphone.",
|
||||
"To finish enabling two factor authentication, scan the following QR code using your phone's authenticator application or enter the setup key and provide the generated OTP code.": "Pour terminer l'activation de l'authentification à deux facteurs, scannez le QR code suivant avec l'application d'authentification de votre téléphone ou saisissez la clé de configuration et fournissez le code OTP généré.",
|
||||
"Two factor authentication is now enabled. Scan the following QR code using your phone's authenticator application or enter the setup key.": "L'authentification à deux facteurs est maintenant activée. Scannez le QR code suivant avec l'application d'authentification de votre téléphone ou saisissez la clé de configuration.",
|
||||
"Setup Key": "Clé de configuration",
|
||||
"Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.": "Conservez ces codes de récupération dans un gestionnaire de mots de passe sécurisé. Ils peuvent être utilisés pour récupérer l'accès à votre compte si votre appareil d'authentification à deux facteurs est perdu.",
|
||||
"Regenerate Recovery Codes": "Régénérer les codes de récupération",
|
||||
"Show Recovery Codes": "Afficher les codes de récupération",
|
||||
"Update Password": "Modifier le mot de passe",
|
||||
"Ensure your account is using a long, random password to stay secure.": "Assurez-vous que votre compte utilise un mot de passe long et aléatoire pour rester sécurisé.",
|
||||
"Current Password": "Mot de passe actuel",
|
||||
"New Password": "Nouveau mot de passe",
|
||||
"Token Name": "Nom du jeton",
|
||||
"Permissions": "Permissions",
|
||||
"Profile Information": "Informations du profil",
|
||||
"Your :provider account has been connected.": "Votre compte :provider a été connecté.",
|
||||
"Account already exists. Check your email to connect your :provider account.": "Un compte existe déjà. Vérifiez votre e-mail pour connecter votre compte :provider.",
|
||||
"Could not login using :provider. Try again later.": "Impossible de se connecter avec :provider. Réessayez plus tard.",
|
||||
"Update your account's profile information and email address.": "Mettez à jour les informations de profil et l'adresse e-mail de votre compte.",
|
||||
"Photo": "Photo",
|
||||
"Select A New Photo": "Sélectionner une nouvelle photo",
|
||||
"Remove Photo": "Supprimer la photo",
|
||||
"API Tokens": "Jetons API",
|
||||
"Manage API Tokens": "Gérer les jetons API",
|
||||
"Create API Token": "Créer un jeton API",
|
||||
"You may delete any of your existing tokens if they are no longer needed.": "Vous pouvez supprimer tout jeton existant s'il n'est plus nécessaire.",
|
||||
"Last used": "Dernière utilisation",
|
||||
"Delete": "Supprimer",
|
||||
"API Token": "Jeton API",
|
||||
"Please copy your new API token. For your security, it won't be shown again.": "Veuillez copier votre nouveau jeton API. Pour votre sécurité, il ne sera plus affiché.",
|
||||
"Copy to clipboard": "Copier dans le presse-papiers",
|
||||
"Successfully copied!": "Copié avec succès !",
|
||||
"API Token Permissions": "Permissions du jeton API",
|
||||
"API tokens allow third-party services to authenticate with Investbrain on your behalf.": "Les jetons API permettent à des services tiers de s'authentifier auprès d'Investbrain en votre nom.",
|
||||
"Delete API Token": "Supprimer le jeton API",
|
||||
"Are you sure you would like to delete this API token?": "Êtes-vous sûr de vouloir supprimer ce jeton API ?",
|
||||
"This is a secure area of the application. Please confirm your password before continuing.": "Il s'agit d'une zone sécurisée de l'application. Veuillez confirmer votre mot de passe avant de continuer.",
|
||||
"Password": "Mot de passe",
|
||||
"Confirm": "Confirmer",
|
||||
"Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.": "Mot de passe oublié ? Pas de problème. Indiquez-nous votre adresse e-mail et nous vous enverrons un lien de réinitialisation du mot de passe.",
|
||||
"Email": "E-mail",
|
||||
"Email Password Reset Link": "Envoyer le lien de réinitialisation du mot de passe",
|
||||
"Remember me": "Se souvenir de moi",
|
||||
"Forgot your password?": "Mot de passe oublié ?",
|
||||
"Name": "Nom",
|
||||
"Confirm Password": "Confirmer le mot de passe",
|
||||
"I agree to the :terms_of_service and :privacy_policy": "J'accepte les :terms_of_service et la :privacy_policy",
|
||||
"Terms of Service": "Conditions d'utilisation",
|
||||
"Privacy Policy": "Politique de confidentialité",
|
||||
"Sign up with email": "S'inscrire avec un e-mail",
|
||||
"Login with": "Se connecter avec",
|
||||
"Already registered?": "Déjà inscrit ?",
|
||||
"Reset Password": "Réinitialiser le mot de passe",
|
||||
"Please confirm access to your account by entering the authentication code provided by your authenticator application.": "Veuillez confirmer l'accès à votre compte en saisissant le code d'authentification fourni par votre application d'authentification.",
|
||||
"Please confirm access to your account by entering one of your emergency recovery codes.": "Veuillez confirmer l'accès à votre compte en saisissant l'un de vos codes de récupération d'urgence.",
|
||||
"Code": "Code",
|
||||
"Recovery Code": "Code de récupération",
|
||||
"Use a recovery code": "Utiliser un code de récupération",
|
||||
"Use an authentication code": "Utiliser un code d'authentification",
|
||||
"Before continuing, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.": "Avant de continuer, pourriez-vous vérifier votre adresse e-mail en cliquant sur le lien que nous venons de vous envoyer ? Si vous n'avez pas reçu l'e-mail, nous vous en enverrons un autre avec plaisir.",
|
||||
"A new verification link has been sent to the email address you provided in your profile settings.": "Un nouveau lien de vérification a été envoyé à l'adresse e-mail que vous avez fournie dans les paramètres de votre profil.",
|
||||
"Resend Verification Email": "Renvoyer l'e-mail de vérification",
|
||||
"Edit Profile": "Modifier le profil",
|
||||
"Upload or recover your Investbrain portfolio and holdings.": "Téléchargez ou récupérez votre portefeuille et vos avoirs Investbrain.",
|
||||
"Download all of your portfolios and transactions.": "Téléchargez tous vos portefeuilles et transactions.",
|
||||
"Import / Export Data": "Importer / Exporter des données",
|
||||
"Successfully imported!": "Importé avec succès !",
|
||||
"Select a file": "Sélectionner un fichier",
|
||||
"Download Export": "Télécharger l'export",
|
||||
"Click to download import template.": "Cliquez pour télécharger le modèle d'importation.",
|
||||
"Download import template.": "Télécharger le modèle d'importation.",
|
||||
"Your email address is unverified.": "Votre adresse e-mail n'est pas vérifiée.",
|
||||
"Click here to re-send the verification email.": "Cliquez ici pour renvoyer l'e-mail de vérification.",
|
||||
"A new verification link has been sent to your email address.": "Un nouveau lien de vérification a été envoyé à votre adresse e-mail.",
|
||||
"The provided password does not match your current password.": "Le mot de passe fourni ne correspond pas à votre mot de passe actuel.",
|
||||
|
||||
"Documentation": "Documentation",
|
||||
"We're open source!": "Nous sommes open source !",
|
||||
"Toggle Theme": "Changer de thème",
|
||||
"Toggle Sidebar": "Afficher/masquer la barre latérale",
|
||||
|
||||
"Dashboard": "Tableau de bord",
|
||||
"Gain/Loss": "Gain/Perte",
|
||||
"Market Gain/Loss": "Gain/Perte sur le marché",
|
||||
"Total Cost Basis": "Coût de base total",
|
||||
"Total Sale Price": "Prix de vente total",
|
||||
"Total Market Value": "Valeur marchande totale",
|
||||
"Realized Gain/Loss": "Gain/Perte réalisé(e)",
|
||||
"Dividends Earned": "Dividendes perçus",
|
||||
"Dividends": "Dividendes",
|
||||
"Holding Options": "Options de l'avoir",
|
||||
"Holding options saved": "Options de l'avoir enregistrées",
|
||||
"Reinvest Dividends": "Réinvestir les dividendes",
|
||||
"Automatically generate buy transactions for any dividends earned": "Générer automatiquement des transactions d'achat pour les dividendes perçus",
|
||||
"Split": "Division",
|
||||
"Splits": "Divisions",
|
||||
"No splits for :symbol yet": "Aucune division pour :symbol pour l'instant",
|
||||
"Distribution Date": "Date de distribution",
|
||||
"My portfolios": "Mes portefeuilles",
|
||||
"Create your first portfolio!": "Créez votre premier portefeuille !",
|
||||
"Wishlist": "Liste de souhaits",
|
||||
"Top performers": "Meilleures performances",
|
||||
"Top headlines": "Principales actualités",
|
||||
"Click or press :key to search": "Cliquez ou appuyez sur :key pour rechercher",
|
||||
"Click to search": "Cliquez pour rechercher",
|
||||
"Search holdings, portfolios, or anything else...": "Rechercher des avoirs, des portefeuilles ou autre chose...",
|
||||
"Darn! Nothing found for that search.": "Zut ! Aucun résultat pour cette recherche.",
|
||||
"Portfolio": "Portefeuille",
|
||||
"Portfolios": "Portefeuilles",
|
||||
"Create Portfolio": "Créer un portefeuille",
|
||||
"Transactions": "Transactions",
|
||||
"Reporting": "Rapports",
|
||||
"Manage Profile": "Gérer le profil",
|
||||
"Symbol": "Symbole",
|
||||
"Quantity": "Quantité",
|
||||
"Quantity Owned": "Quantité détenue",
|
||||
"The quantity must not be greater than the available quantity.": "La quantité ne doit pas être supérieure à la quantité disponible.",
|
||||
"Average Cost Basis": "Coût de base moyen",
|
||||
"Market Value": "Valeur marchande",
|
||||
"52 week": "52 semaines",
|
||||
"52 week low": "Plus bas sur 52 semaines",
|
||||
"52 week high": "Plus haut sur 52 semaines",
|
||||
"Forward PE": "PER prospectif",
|
||||
"Trailing PE": "PER historique",
|
||||
"Market Cap": "Capitalisation boursière",
|
||||
"Book Value": "Valeur comptable",
|
||||
"Dividend Yield": "Rendement du dividende",
|
||||
"Last Dividend Paid": "Dernier dividende versé",
|
||||
"Ex Dividend Date": "Date ex-dividende",
|
||||
"No dividends for :symbol yet": "Aucun dividende pour :symbol pour l'instant",
|
||||
"Number of Transactions": "Nombre de transactions",
|
||||
"Last Refreshed": "Dernière mise à jour",
|
||||
"Portfolio updated": "Portefeuille mis à jour",
|
||||
"Portfolio created": "Portefeuille créé",
|
||||
"Portfolio deleted": "Portefeuille supprimé",
|
||||
"Title": "Titre",
|
||||
"Notes": "Notes",
|
||||
"Treat this portfolio as a \"wishlist\" (holdings will be excluded from realized gains, unrealized gains, and dividends)": "Traiter ce portefeuille comme une « liste de souhaits » (les avoirs seront exclus des gains réalisés, des gains non réalisés et des dividendes)",
|
||||
"Delete Portfolio": "Supprimer le portefeuille",
|
||||
"Are you sure you want to delete this portfolio? Once a portfolio is deleted, all of its holdings and other data will be permanently deleted.": "Êtes-vous sûr de vouloir supprimer ce portefeuille ? Une fois un portefeuille supprimé, tous ses avoirs et autres données seront définitivement supprimés.",
|
||||
"Transaction updated": "Transaction mise à jour",
|
||||
"Transaction created": "Transaction créée",
|
||||
"Transaction deleted": "Transaction supprimée",
|
||||
"Transaction Type": "Type de transaction",
|
||||
"Transaction Date": "Date de transaction",
|
||||
"Delete Transaction": "Supprimer la transaction",
|
||||
"Are you sure you want to delete this transaction?": "Êtes-vous sûr de vouloir supprimer cette transaction ?",
|
||||
"Cost Basis": "Coût de base",
|
||||
"Sale Price": "Prix de vente",
|
||||
"Market Gain": "Gain sur le marché",
|
||||
"Realized Gains": "Gains réalisés",
|
||||
"Performance": "Performance",
|
||||
"Reset chart": "Réinitialiser le graphique",
|
||||
"Choose time period": "Choisir une période",
|
||||
"Manage Portfolio": "Gérer le portefeuille",
|
||||
"Create Transaction": "Créer une transaction",
|
||||
"Manage Transaction": "Gérer la transaction",
|
||||
"Holding": "Avoir",
|
||||
"Holdings": "Avoirs",
|
||||
"Recent activity": "Activité récente",
|
||||
"All Transactions": "Toutes les transactions",
|
||||
|
||||
"validation.accepted": "Ce champ doit être accepté.",
|
||||
"validation.accepted_if": "Ce champ doit être accepté lorsque :other est :value.",
|
||||
"validation.active_url": "Ce champ n'est pas une URL valide.",
|
||||
"validation.after": "Ce champ doit être une date postérieure à :date.",
|
||||
"validation.after_or_equal": "Ce champ doit être une date postérieure ou égale à :date.",
|
||||
"validation.alpha": "Ce champ ne doit contenir que des lettres.",
|
||||
"validation.alpha_dash": "Ce champ ne doit contenir que des lettres, des chiffres, des tirets et des underscores.",
|
||||
"validation.alpha_num": "Ce champ ne doit contenir que des lettres et des chiffres.",
|
||||
"validation.array": "Ce champ doit être un tableau.",
|
||||
"validation.ascii": "Ce champ ne doit contenir que des caractères alphanumériques et des symboles à un seul octet.",
|
||||
"validation.attached": "Ce champ est déjà attaché.",
|
||||
"validation.before": "Ce champ doit être une date antérieure à :date.",
|
||||
"validation.before_or_equal": "Ce champ doit être une date antérieure ou égale à :date.",
|
||||
"validation.between.array": "Ce champ doit contenir entre :min et :max éléments.",
|
||||
"validation.between.file": "Ce champ doit être compris entre :min et :max kilo-octets.",
|
||||
"validation.between.numeric": "Ce champ doit être compris entre :min et :max.",
|
||||
"validation.between.string": "Ce champ doit contenir entre :min et :max caractères.",
|
||||
"validation.boolean": "Ce champ doit être vrai ou faux.",
|
||||
"validation.can": "Ce champ contient une valeur non autorisée.",
|
||||
"validation.confirmed": "La confirmation de ce champ ne correspond pas.",
|
||||
"validation.contains": "Ce champ est absent d'une valeur requise.",
|
||||
"validation.date": "Ce champ n'est pas une date valide.",
|
||||
"validation.date_equals": "Ce champ doit être une date égale à :date.",
|
||||
"validation.date_format": "Ce champ ne correspond pas au format :format.",
|
||||
"validation.decimal": "Ce champ doit avoir :decimal décimales.",
|
||||
"validation.declined": "Ce champ doit être refusé.",
|
||||
"validation.declined_if": "Ce champ doit être refusé lorsque :other est :value.",
|
||||
"validation.different": "Ce champ et :other doivent être différents.",
|
||||
"validation.digits": "Ce champ doit contenir :digits chiffres.",
|
||||
"validation.digits_between": "Ce champ doit contenir entre :min et :max chiffres.",
|
||||
"validation.dimensions": "Ce champ a des dimensions d'image invalides.",
|
||||
"validation.distinct": "Ce champ a une valeur en double.",
|
||||
"validation.doesnt_end_with": "Ce champ ne doit pas se terminer par l'un des éléments suivants : :values.",
|
||||
"validation.doesnt_start_with": "Ce champ ne doit pas commencer par l'un des éléments suivants : :values.",
|
||||
"validation.email": "Ce champ doit être une adresse e-mail valide.",
|
||||
"validation.ends_with": "Ce champ doit se terminer par l'un des éléments suivants : :values.",
|
||||
"validation.enum": "La valeur sélectionnée ne fait pas partie des valeurs autorisées.",
|
||||
"validation.exists": "La valeur sélectionnée n'existe pas.",
|
||||
"validation.extensions": "Ce champ doit avoir l'une des extensions suivantes : :values.",
|
||||
"validation.file": "Ce champ doit être un fichier.",
|
||||
"validation.filled": "Ce champ doit avoir une valeur.",
|
||||
"validation.gt.array": "Ce champ doit avoir plus de :value éléments.",
|
||||
"validation.gt.file": "Ce champ doit être supérieur à :value kilo-octets.",
|
||||
"validation.gt.numeric": "Ce champ doit être supérieur à :value.",
|
||||
"validation.gt.string": "Ce champ doit contenir plus de :value caractères.",
|
||||
"validation.gte.array": "Ce champ doit avoir :value éléments ou plus.",
|
||||
"validation.gte.file": "Ce champ doit être supérieur ou égal à :value kilo-octets.",
|
||||
"validation.gte.numeric": "Ce champ doit être supérieur ou égal à :value.",
|
||||
"validation.gte.string": "Ce champ doit contenir :value caractères ou plus.",
|
||||
"validation.hex_color": "Ce champ doit être une couleur hexadécimale valide.",
|
||||
"validation.image": "Ce champ doit être une image.",
|
||||
"validation.in": "La valeur sélectionnée ne fait pas partie des valeurs autorisées.",
|
||||
"validation.in_array": "Ce champ n'existe pas dans :other.",
|
||||
"validation.integer": "Ce champ doit être un entier.",
|
||||
"validation.ip": "Ce champ doit être une adresse IP valide.",
|
||||
"validation.ipv4": "Ce champ doit être une adresse IPv4 valide.",
|
||||
"validation.ipv6": "Ce champ doit être une adresse IPv6 valide.",
|
||||
"validation.json": "Ce champ doit être une chaîne JSON valide.",
|
||||
"validation.list": "Ce champ doit être une liste.",
|
||||
"validation.lowercase": "Ce champ doit être en minuscules.",
|
||||
"validation.lt.array": "Ce champ doit avoir moins de :value éléments.",
|
||||
"validation.lt.file": "Ce champ doit être inférieur à :value kilo-octets.",
|
||||
"validation.lt.numeric": "Ce champ doit être inférieur à :value.",
|
||||
"validation.lt.string": "Ce champ doit contenir moins de :value caractères.",
|
||||
"validation.lte.array": "Ce champ ne doit pas avoir plus de :value éléments.",
|
||||
"validation.lte.file": "Ce champ doit être inférieur ou égal à :value kilo-octets.",
|
||||
"validation.lte.numeric": "Ce champ doit être inférieur ou égal à :value.",
|
||||
"validation.lte.string": "Ce champ doit contenir :value caractères ou moins.",
|
||||
"validation.mac_address": "Ce champ doit être une adresse MAC valide.",
|
||||
"validation.max.array": "Ce champ ne doit pas avoir plus de :max éléments.",
|
||||
"validation.max.file": "Ce champ ne doit pas être supérieur à :max kilo-octets.",
|
||||
"validation.max.numeric": "Ce champ ne doit pas être supérieur à :max.",
|
||||
"validation.max.string": "Ce champ ne doit pas contenir plus de :max caractères.",
|
||||
"validation.max_digits": "Ce champ ne doit pas avoir plus de :max chiffres.",
|
||||
"validation.mimes": "Ce champ doit être un fichier de type : :values.",
|
||||
"validation.mimetypes": "Ce champ doit être un fichier de type : :values.",
|
||||
"validation.min.array": "Ce champ doit avoir au moins :min éléments.",
|
||||
"validation.min.file": "Ce champ doit faire au moins :min kilo-octets.",
|
||||
"validation.min.numeric": "Ce champ doit être au moins :min.",
|
||||
"validation.min.string": "Ce champ doit contenir au moins :min caractères.",
|
||||
"validation.min_digits": "Ce champ doit avoir au moins :min chiffres.",
|
||||
"validation.missing": "Ce champ doit être absent.",
|
||||
"validation.missing_if": "Ce champ doit être absent lorsque :other est :value.",
|
||||
"validation.missing_unless": "Ce champ doit être absent sauf si :other est :value.",
|
||||
"validation.missing_with": "Ce champ doit être absent lorsque :values est présent.",
|
||||
"validation.missing_with_all": "Ce champ doit être absent lorsque :values sont présents.",
|
||||
"validation.multiple_of": "Ce champ doit être un multiple de :value.",
|
||||
"validation.not_in": "La valeur sélectionnée ne doit pas être dans la liste.",
|
||||
"validation.not_regex": "Le format de ce champ est invalide.",
|
||||
"validation.numeric": "Ce champ doit être un nombre.",
|
||||
"validation.password.letters": "Ce champ doit contenir au moins une lettre.",
|
||||
"validation.password.mixed": "Ce champ doit contenir au moins une lettre majuscule et une lettre minuscule.",
|
||||
"validation.password.numbers": "Ce champ doit contenir au moins un chiffre.",
|
||||
"validation.password.symbols": "Ce champ doit contenir au moins un symbole.",
|
||||
"validation.password.uncompromised": "Ce champ est apparu dans une fuite de données. Veuillez choisir un autre champ.",
|
||||
"validation.present": "Ce champ doit être présent.",
|
||||
"validation.present_if": "Ce champ doit être présent lorsque :other est :value.",
|
||||
"validation.present_unless": "Ce champ doit être présent sauf si :other est :value.",
|
||||
"validation.present_with": "Ce champ doit être présent lorsque :values est présent.",
|
||||
"validation.present_with_all": "Ce champ doit être présent lorsque :values sont présents.",
|
||||
"validation.prohibited": "Ce champ est interdit.",
|
||||
"validation.prohibited_if": "Ce champ est interdit lorsque :other est :value.",
|
||||
"validation.prohibited_unless": "Ce champ est interdit sauf si :other est dans :values.",
|
||||
"validation.prohibits": "Ce champ interdit la présence de :other.",
|
||||
"validation.regex": "Le format de ce champ est invalide.",
|
||||
"validation.relatable": "Ce champ ne peut pas être associé à cette ressource.",
|
||||
"validation.required": "Ce champ est obligatoire.",
|
||||
"validation.required_array_keys": "Ce champ doit contenir des entrées pour : :values.",
|
||||
"validation.required_if": "Ce champ est obligatoire lorsque :other est :value.",
|
||||
"validation.required_if_accepted": "Ce champ est obligatoire lorsque :other est accepté.",
|
||||
"validation.required_if_declined": "Ce champ est obligatoire lorsque :other est refusé.",
|
||||
"validation.required_unless": "Ce champ est obligatoire sauf si :other est dans :values.",
|
||||
"validation.required_with": "Ce champ est obligatoire lorsque :values est présent.",
|
||||
"validation.required_with_all": "Ce champ est obligatoire lorsque :values sont présents.",
|
||||
"validation.required_without": "Ce champ est obligatoire lorsque :values est absent.",
|
||||
"validation.required_without_all": "Ce champ est obligatoire lorsque aucun des éléments :values n'est présent.",
|
||||
"validation.same": "Ce champ et :other doivent correspondre.",
|
||||
"validation.size.array": "Ce champ doit contenir :size éléments.",
|
||||
"validation.size.file": "Ce champ doit faire :size kilo-octets.",
|
||||
"validation.size.numeric": "Ce champ doit être :size.",
|
||||
"validation.size.string": "Ce champ doit contenir :size caractères.",
|
||||
"validation.starts_with": "Ce champ doit commencer par l'un des éléments suivants : :values.",
|
||||
"validation.string": "Ce champ doit être une chaîne de caractères.",
|
||||
"validation.timezone": "Ce champ doit être un fuseau horaire valide.",
|
||||
"validation.ulid": "Ce champ doit être un ULID valide.",
|
||||
"validation.unique": "Cette valeur est déjà utilisée.",
|
||||
"validation.uploaded": "Ce champ n'a pas pu être téléchargé.",
|
||||
"validation.uppercase": "Ce champ doit être en majuscules.",
|
||||
"validation.url": "Ce champ doit être une URL valide.",
|
||||
"validation.uuid": "Ce champ doit être un UUID valide.",
|
||||
|
||||
"passwords.reset": "Votre mot de passe a été réinitialisé.",
|
||||
"passwords.sent": "Nous vous avons envoyé votre lien de réinitialisation du mot de passe par e-mail.",
|
||||
"passwords.throttled": "Veuillez patienter avant de réessayer.",
|
||||
"passwords.token": "Ce jeton de réinitialisation du mot de passe est invalide.",
|
||||
"passwords.user": "Nous ne trouvons pas d'utilisateur avec cette adresse e-mail.",
|
||||
|
||||
"pagination.previous": "« Précédent",
|
||||
"pagination.next": "Suivant »",
|
||||
|
||||
"auth.failed": "Ces identifiants ne correspondent pas à nos enregistrements.",
|
||||
"auth.password": "Le mot de passe fourni est incorrect.",
|
||||
"auth.throttle": "Trop de tentatives de connexion. Veuillez réessayer dans :seconds secondes.",
|
||||
|
||||
"Add People": "Ajouter des personnes",
|
||||
"People with access": "Personnes ayant accès",
|
||||
"Owner": "Propriétaire",
|
||||
"Read only": "Lecture seule",
|
||||
"Full access": "Accès complet",
|
||||
"You do not have permission to manage transactions for this portfolio": "Vous n'avez pas la permission de gérer les transactions de ce portefeuille",
|
||||
"Updated user's access permission to portfolio": "Permission d'accès de l'utilisateur au portefeuille mise à jour",
|
||||
"Removed user's access to portfolio": "Accès de l'utilisateur au portefeuille supprimé",
|
||||
"Shared portfolio with user": "Portefeuille partagé avec l'utilisateur",
|
||||
"Share Portfolio": "Partager le portefeuille",
|
||||
"Type an email address to share portfolio": "Saisissez une adresse e-mail pour partager le portefeuille",
|
||||
"Grant full access": "Accorder l'accès complet",
|
||||
"Allow this user to manage portfolio details and create or update transactions": "Autoriser cet utilisateur à gérer les détails du portefeuille et à créer ou mettre à jour des transactions",
|
||||
"Share": "Partager",
|
||||
"Remove Access": "Supprimer l'accès",
|
||||
"By removing this person's access, they will no longer be able to view this portfolio. They will lose access immediately.": "En supprimant l'accès de cette personne, elle ne pourra plus consulter ce portefeuille. Elle perdra l'accès immédiatement.",
|
||||
|
||||
"Hey again!": "Ravi de vous revoir !",
|
||||
"Before you can get started with Investbrain, let's complete your profile:": "Avant de commencer avec Investbrain, complétons votre profil :",
|
||||
"Get Started": "Commencer",
|
||||
|
||||
"You do not have access to that portfolio.": "Vous n'avez pas accès à ce portefeuille.",
|
||||
"Import starting...": "Importation en cours de démarrage...",
|
||||
"Import is in progress...": "Importation en cours...",
|
||||
"Importing portfolios...": "Importation des portefeuilles...",
|
||||
"Preparing to import transactions...": "Préparation de l'importation des transactions...",
|
||||
"Importing transactions (Batch :currentBatch of :totalBatches)...": "Importation des transactions (Lot :currentBatch sur :totalBatches)...",
|
||||
"Preparing to import daily changes...": "Préparation de l'importation des variations journalières...",
|
||||
"Importing daily changes (Batch :currentBatch of :totalBatches)...": "Importation des variations journalières (Lot :currentBatch sur :totalBatches)...",
|
||||
"Importing configurations...": "Importation des configurations...",
|
||||
"Import completed successfully!": "Importation terminée avec succès !",
|
||||
"Your import will continue in the background": "Votre importation continuera en arrière-plan",
|
||||
|
||||
"AI Chat": "Chat IA",
|
||||
"Hi, how can I help?": "Bonjour, comment puis-je vous aider ?",
|
||||
"Have a question? AI might be able to help...": "Vous avez une question ? L'IA pourrait peut-être vous aider...",
|
||||
"Feel free to ask me a question!": "N'hésitez pas à me poser une question !",
|
||||
"Advice generated by AI may contain errors. Use at your own risk. Always consult a licensed investment advisor.": "Les conseils générés par l'IA peuvent contenir des erreurs. Utilisez à vos propres risques. Consultez toujours un conseiller en investissement agréé.",
|
||||
|
||||
"Currency": "Devise",
|
||||
"Locale Options": "Options de localisation",
|
||||
"Adjust localization options for your preferred region.": "Ajustez les options de localisation pour votre région préférée.",
|
||||
"Locale": "Locale",
|
||||
"Display Currency": "Devise d'affichage"
|
||||
}
|
||||
Generated
+679
-1301
File diff suppressed because it is too large
Load Diff
+7
-2
@@ -8,15 +8,20 @@
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"axios": "^1.7.4",
|
||||
"daisyui": "^4.12.10",
|
||||
"daisyui": "^5.1.14",
|
||||
"laravel-vite-plugin": "^1.0",
|
||||
"postcss": "^8.4.40",
|
||||
"tailwindcss": "^3.4.7",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"vite": "^5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alpinejs/focus": "^3.15.0",
|
||||
"@alpinejs/persist": "^3.15.4",
|
||||
"@alpinejs/resize": "^3.14.9",
|
||||
"alpinejs": "^3.14.9",
|
||||
"apexcharts": "^3.51.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:svgjs="http://svgjs.dev/svgjs" viewBox="0 0 700 700" width="700" height="700" opacity="0.25">
|
||||
<defs>
|
||||
<filter id="nnnoise-filter" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox"
|
||||
primitiveUnits="userSpaceOnUse" color-interpolation-filters="linearRGB">
|
||||
<feTurbulence type="fractalNoise" baseFrequency="0.2" numOctaves="4" seed="15" stitchTiles="stitch" x="0%"
|
||||
y="0%" width="100%" height="100%" result="turbulence"></feTurbulence>
|
||||
<feSpecularLighting surfaceScale="5" specularConstant="1" specularExponent="20" lighting-color="#3939A8"
|
||||
x="0%" y="0%" width="100%" height="100%" in="turbulence" result="specularLighting">
|
||||
<feDistantLight azimuth="3" elevation="18"></feDistantLight>
|
||||
</feSpecularLighting>
|
||||
<feColorMatrix type="saturate" values="0" x="0%" y="0%" width="100%" height="100%" in="specularLighting"
|
||||
result="colormatrix"></feColorMatrix>
|
||||
</filter>
|
||||
</defs>
|
||||
<rect width="700" height="700" fill="transparent"></rect>
|
||||
<rect width="700" height="700" class="fill-current" filter="url(#nnnoise-filter)"></rect>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
(()=>{var n=({livewireId:e})=>({actionNestingIndex:null,init(){window.addEventListener("sync-action-modals",t=>{t.detail.id===e&&this.syncActionModals(t.detail.newActionNestingIndex,t.detail.shouldOverlayParentActions??!1)})},syncActionModals(t,i=!1){if(this.actionNestingIndex===t){this.actionNestingIndex!==null&&this.$nextTick(()=>this.openModal());return}let s=this.actionNestingIndex!==null&&t!==null&&t>this.actionNestingIndex;if(this.actionNestingIndex!==null&&!(i&&s)&&this.closeModal(),this.actionNestingIndex=t,this.actionNestingIndex!==null){if(!this.$el.querySelector(`#${this.generateModalId(t)}`)){this.$nextTick(()=>this.openModal());return}this.openModal()}},generateModalId(t){return`fi-${e}-action-`+t},openModal(){let t=this.generateModalId(this.actionNestingIndex);document.dispatchEvent(new CustomEvent("open-modal",{bubbles:!0,composed:!0,detail:{id:t}}))},closeModal(){let t=this.generateModalId(this.actionNestingIndex);document.dispatchEvent(new CustomEvent("close-modal-quietly",{bubbles:!0,composed:!0,detail:{id:t}}))}});document.addEventListener("alpine:init",()=>{window.Alpine.data("filamentActionModals",n)});})();
|
||||
@@ -0,0 +1 @@
|
||||
function c({livewireId:s}){return{areAllCheckboxesChecked:!1,checkboxListOptions:[],search:"",unsubscribeLivewireHook:null,visibleCheckboxListOptions:[],init(){this.checkboxListOptions=Array.from(this.$root.querySelectorAll(".fi-fo-checkbox-list-option")),this.updateVisibleCheckboxListOptions(),this.$nextTick(()=>{this.checkIfAllCheckboxesAreChecked()}),this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{t(()=>{this.$nextTick(()=>{e.component.id===s&&(this.checkboxListOptions=Array.from(this.$root.querySelectorAll(".fi-fo-checkbox-list-option")),this.updateVisibleCheckboxListOptions(),this.checkIfAllCheckboxesAreChecked())})})}),this.$watch("search",()=>{this.updateVisibleCheckboxListOptions(),this.checkIfAllCheckboxesAreChecked()})},checkIfAllCheckboxesAreChecked(){this.areAllCheckboxesChecked=this.visibleCheckboxListOptions.length===this.visibleCheckboxListOptions.filter(e=>e.querySelector("input[type=checkbox]:checked, input[type=checkbox]:disabled")).length},toggleAllCheckboxes(){this.checkIfAllCheckboxesAreChecked();let e=!this.areAllCheckboxesChecked;this.visibleCheckboxListOptions.forEach(t=>{let i=t.querySelector("input[type=checkbox]");i.disabled||i.checked!==e&&(i.checked=e,i.dispatchEvent(new Event("change")))}),this.areAllCheckboxesChecked=e},updateVisibleCheckboxListOptions(){this.visibleCheckboxListOptions=this.checkboxListOptions.filter(e=>["",null,void 0].includes(this.search)||e.querySelector(".fi-fo-checkbox-list-option-label")?.innerText.toLowerCase().includes(this.search.toLowerCase())?!0:e.querySelector(".fi-fo-checkbox-list-option-description")?.innerText.toLowerCase().includes(this.search.toLowerCase()))},destroy(){this.unsubscribeLivewireHook?.()}}}export{c as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
function a({state:r}){return{state:r,rows:[],init(){this.updateRows(),this.rows.length<=0?this.rows.push({key:"",value:""}):this.updateState(),this.$watch("state",(e,t)=>{if(!Array.isArray(e))return;let s=i=>i===null?0:Array.isArray(i)?i.length:typeof i!="object"?0:Object.keys(i).length;s(e)===0&&s(t)===0||this.updateRows()})},addRow(){this.rows.push({key:"",value:""}),this.updateState()},deleteRow(e){this.rows.splice(e,1),this.rows.length<=0&&this.addRow(),this.updateState()},reorderRows(e){let t=Alpine.raw(this.rows);this.rows=[];let s=t.splice(e.oldIndex,1)[0];t.splice(e.newIndex,0,s),this.$nextTick(()=>{this.rows=t,this.updateState()})},updateRows(){let t=Alpine.raw(this.state).map(({key:s,value:i})=>({key:s,value:i}));this.rows.forEach(s=>{(s.key===""||s.key===null)&&t.push({key:"",value:s.value})}),this.rows=t},updateState(){let e=[];this.rows.forEach(t=>{t.key===""||t.key===null||e.push({key:t.key,value:t.value})}),JSON.stringify(this.state)!==JSON.stringify(e)&&(this.state=e)}}}export{a as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
function s({state:n,splitKeys:a}){return{newTag:"",state:n,createTag(){if(this.newTag=this.newTag.trim(),this.newTag!==""){if(this.state.includes(this.newTag)){this.newTag="";return}this.state.push(this.newTag),this.newTag=""}},deleteTag(t){this.state=this.state.filter(e=>e!==t)},reorderTags(t){let e=this.state.splice(t.oldIndex,1)[0];this.state.splice(t.newIndex,0,e),this.state=[...this.state]},input:{"x-on:blur":"createTag()","x-model":"newTag","x-on:keydown"(t){["Enter",...a].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.createTag())},"x-on:paste"(){this.$nextTick(()=>{if(a.length===0){this.createTag();return}let t=a.map(e=>e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")).join("|");this.newTag.split(new RegExp(t,"g")).forEach(e=>{this.newTag=e,this.createTag()})})}}}}export{s as default};
|
||||
@@ -0,0 +1 @@
|
||||
function n({initialHeight:e,shouldAutosize:i,state:h}){return{state:h,wrapperEl:null,init(){this.wrapperEl=this.$el.parentNode,this.setInitialHeight(),i?this.$watch("state",()=>{this.resize()}):this.setUpResizeObserver()},setInitialHeight(){this.$el.scrollHeight<=0||(this.wrapperEl.style.height=e+"rem")},resize(){if(this.$el.scrollHeight<=0)return;let t=this.$el.style.height;this.$el.style.height="0px";let r=this.$el.scrollHeight;this.$el.style.height=t;let l=parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),s=Math.max(r,l)+"px";this.wrapperEl.style.height!==s&&(this.wrapperEl.style.height=s)},setUpResizeObserver(){new ResizeObserver(()=>{this.wrapperEl.style.height=this.$el.style.height}).observe(this.$el)}}}export{n as default};
|
||||
@@ -0,0 +1 @@
|
||||
(()=>{function c(s,t=()=>{}){let i=!1;return function(){i?t.apply(this,arguments):(i=!0,s.apply(this,arguments))}}var d=s=>{s.data("notificationComponent",({notification:t})=>({isShown:!1,computedStyle:null,transitionDuration:null,transitionEasing:null,unsubscribeLivewireHook:null,init(){this.computedStyle=window.getComputedStyle(this.$el),this.transitionDuration=parseFloat(this.computedStyle.transitionDuration)*1e3,this.transitionEasing=this.computedStyle.transitionTimingFunction,this.configureTransitions(),this.configureAnimations(),t.duration&&t.duration!=="persistent"&&setTimeout(()=>{if(!this.$el.matches(":hover")){this.close();return}this.$el.addEventListener("mouseleave",()=>this.close())},t.duration),this.isShown=!0},configureTransitions(){let i=this.computedStyle.display,e=()=>{s.mutateDom(()=>{this.$el.style.setProperty("display",i),this.$el.style.setProperty("visibility","visible")}),this.$el._x_isShown=!0},o=()=>{s.mutateDom(()=>{this.$el._x_isShown?this.$el.style.setProperty("visibility","hidden"):this.$el.style.setProperty("display","none")})},r=c(n=>n?e():o(),n=>{this.$el._x_toggleAndCascadeWithTransitions(this.$el,n,e,o)});s.effect(()=>r(this.isShown))},configureAnimations(){let i;this.unsubscribeLivewireHook=Livewire.interceptMessage(({onFinish:e,onSuccess:o})=>{requestAnimationFrame(()=>{let r=()=>this.$el.getBoundingClientRect().top,n=r();e(()=>{i=()=>{this.isShown&&this.$el.animate([{transform:`translateY(${n-r()}px)`},{transform:"translateY(0px)"}],{duration:this.transitionDuration,easing:this.transitionEasing})},this.$el.getAnimations().forEach(l=>l.finish())}),o(({payload:l})=>{l?.snapshot?.data?.isFilamentNotificationsComponent&&typeof i=="function"&&i()})})})},close(){this.isShown=!1,setTimeout(()=>window.dispatchEvent(new CustomEvent("notificationClosed",{detail:{id:t.id}})),this.transitionDuration)},markAsRead(){window.dispatchEvent(new CustomEvent("markedNotificationAsRead",{detail:{id:t.id}}))},markAsUnread(){window.dispatchEvent(new CustomEvent("markedNotificationAsUnread",{detail:{id:t.id}}))},destroy(){this.unsubscribeLivewireHook?.()}}))};var h=class{constructor(){return this.id(crypto.randomUUID?.()??"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4).toString(16))),this}id(t){return this.id=t,this}title(t){return this.title=t,this}body(t){return this.body=t,this}actions(t){return this.actions=t,this}status(t){return this.status=t,this}color(t){return this.color=t,this}icon(t){return this.icon=t,this}iconColor(t){return this.iconColor=t,this}duration(t){return this.duration=t,this}seconds(t){return this.duration(t*1e3),this}persistent(){return this.duration("persistent"),this}danger(){return this.status("danger"),this}info(){return this.status("info"),this}success(){return this.status("success"),this}warning(){return this.status("warning"),this}view(t){return this.view=t,this}viewData(t){return this.viewData=t,this}send(){return window.dispatchEvent(new CustomEvent("notificationSent",{detail:{notification:this}})),this}},a=class{constructor(t){return this.name(t),this}name(t){return this.name=t,this}color(t){return this.color=t,this}dispatch(t,i){return this.event(t),this.eventData(i),this}dispatchSelf(t,i){return this.dispatch(t,i),this.dispatchDirection="self",this}dispatchTo(t,i,e){return this.dispatch(i,e),this.dispatchDirection="to",this.dispatchToComponent=t,this}emit(t,i){return this.dispatch(t,i),this}emitSelf(t,i){return this.dispatchSelf(t,i),this}emitTo(t,i,e){return this.dispatchTo(t,i,e),this}dispatchDirection(t){return this.dispatchDirection=t,this}dispatchToComponent(t){return this.dispatchToComponent=t,this}event(t){return this.event=t,this}eventData(t){return this.eventData=t,this}extraAttributes(t){return this.extraAttributes=t,this}icon(t){return this.icon=t,this}iconPosition(t){return this.iconPosition=t,this}outlined(t=!0){return this.isOutlined=t,this}disabled(t=!0){return this.isDisabled=t,this}label(t){return this.label=t,this}close(t=!0){return this.shouldClose=t,this}openUrlInNewTab(t=!0){return this.shouldOpenUrlInNewTab=t,this}size(t){return this.size=t,this}url(t){return this.url=t,this}view(t){return this.view=t,this}button(){return this.view("filament::components.button.index"),this}grouped(){return this.view("filament::components.dropdown.list.item"),this}iconButton(){return this.view("filament::components.icon-button"),this}link(){return this.view("filament::components.link"),this}},u=class{constructor(t){return this.actions(t),this}actions(t){return this.actions=t.map(i=>i.grouped()),this}color(t){return this.color=t,this}icon(t){return this.icon=t,this}iconPosition(t){return this.iconPosition=t,this}label(t){return this.label=t,this}tooltip(t){return this.tooltip=t,this}};window.FilamentNotificationAction=a;window.FilamentNotificationActionGroup=u;window.FilamentNotification=h;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(d)});})();
|
||||
@@ -0,0 +1 @@
|
||||
var i=()=>({isSticky:!1,width:0,resizeObserver:null,boundUpdateWidth:null,init(){let e=this.$el.parentElement;e&&(this.updateWidth(),this.resizeObserver=new ResizeObserver(()=>this.updateWidth()),this.resizeObserver.observe(e),this.boundUpdateWidth=this.updateWidth.bind(this),window.addEventListener("resize",this.boundUpdateWidth))},enableSticky(){this.isSticky=this.$el.getBoundingClientRect().top>0},disableSticky(){this.isSticky=!1},updateWidth(){let e=this.$el.parentElement;if(!e)return;let t=getComputedStyle(this.$root.querySelector(".fi-ac"));this.width=e.offsetWidth+parseInt(t.marginInlineStart,10)*-1+parseInt(t.marginInlineEnd,10)*-1},destroy(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.boundUpdateWidth&&(window.removeEventListener("resize",this.boundUpdateWidth),this.boundUpdateWidth=null)}});export{i as default};
|
||||
@@ -0,0 +1 @@
|
||||
function v({activeTab:w,isScrollable:f,isTabPersistedInQueryString:m,livewireId:g,tab:T,tabQueryStringKey:r}){return{boundResizeHandler:null,isScrollable:f,resizeDebounceTimer:null,tab:T,unsubscribeLivewireHook:null,withinDropdownIndex:null,withinDropdownMounted:!1,init(){let t=this.getTabs(),e=new URLSearchParams(window.location.search);m&&e.has(r)&&t.includes(e.get(r))&&(this.tab=e.get(r)),(!this.tab||!t.includes(this.tab))&&(this.tab=t[w-1]),this.$watch("tab",()=>{this.updateQueryString(),this.autofocusFields()}),this.autofocusFields(!0),this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:i,onSuccess:a})=>{a(()=>{this.$nextTick(()=>{if(i.component.id!==g)return;let l=this.getTabs();l.includes(this.tab)||(this.tab=l[w-1]??this.tab)})})}),f||(this.boundResizeHandler=this.debouncedUpdateTabsWithinDropdown.bind(this),window.addEventListener("resize",this.boundResizeHandler),this.updateTabsWithinDropdown())},calculateAvailableWidth(t){let e=window.getComputedStyle(t);return Math.floor(t.clientWidth)-Math.ceil(parseFloat(e.paddingLeft))*2},calculateContainerGap(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.columnGap))},calculateDropdownIconWidth(t){let e=t.querySelector(".fi-icon");return Math.ceil(e.clientWidth)},calculateTabItemGap(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.columnGap)||8)},calculateTabItemPadding(t){let e=window.getComputedStyle(t);return Math.ceil(parseFloat(e.paddingLeft))+Math.ceil(parseFloat(e.paddingRight))},findOverflowIndex(t,e,i,a,l,h){let u=t.map(n=>Math.ceil(n.clientWidth)),b=t.map(n=>{let c=n.querySelector(".fi-tabs-item-label"),s=n.querySelector(".fi-badge"),o=Math.ceil(c.clientWidth),d=s?Math.ceil(s.clientWidth):0;return{label:o,badge:d,total:o+(d>0?a+d:0)}});for(let n=0;n<t.length;n++){let c=u.slice(0,n+1).reduce((p,y)=>p+y,0),s=n*i,o=b.slice(n+1),d=o.length>0,D=d?Math.max(...o.map(p=>p.total)):0,W=d?l+D+a+h+i:0;if(c+s+W>e)return n}return-1},get isDropdownButtonVisible(){return this.withinDropdownMounted?this.withinDropdownIndex===null?!1:this.getTabs().findIndex(e=>e===this.tab)<this.withinDropdownIndex:!0},getTabs(){return this.$refs.tabsData?JSON.parse(this.$refs.tabsData.value):[]},updateQueryString(){if(!m)return;let t=new URL(window.location.href);t.searchParams.set(r,this.tab),history.replaceState(null,document.title,t.toString())},autofocusFields(t=!1){this.$nextTick(()=>{if(t&&document.activeElement&&document.activeElement!==document.body&&this.$el.compareDocumentPosition(document.activeElement)&Node.DOCUMENT_POSITION_PRECEDING)return;let e=this.$el.querySelectorAll(".fi-sc-tabs-tab.fi-active [autofocus]");for(let i of e)if(i.focus(),document.activeElement===i)break})},debouncedUpdateTabsWithinDropdown(){clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>this.updateTabsWithinDropdown(),150)},async updateTabsWithinDropdown(){this.withinDropdownIndex=null,this.withinDropdownMounted=!1,await this.$nextTick();let t=this.$el.querySelector(".fi-tabs"),e=t.querySelector(".fi-tabs-item:last-child"),i=Array.from(t.children).slice(0,-1),a=i.map(s=>s.style.display);i.forEach(s=>s.style.display=""),t.offsetHeight;let l=this.calculateAvailableWidth(t),h=this.calculateContainerGap(t),u=this.calculateDropdownIconWidth(e),b=this.calculateTabItemGap(i[0]),n=this.calculateTabItemPadding(i[0]),c=this.findOverflowIndex(i,l,h,b,n,u);i.forEach((s,o)=>s.style.display=a[o]),c!==-1&&(this.withinDropdownIndex=c),this.withinDropdownMounted=!0},destroy(){this.unsubscribeLivewireHook?.(),this.boundResizeHandler&&window.removeEventListener("resize",this.boundResizeHandler),clearTimeout(this.resizeDebounceTimer)}}}export{v as default};
|
||||
@@ -0,0 +1 @@
|
||||
function p({isSkippable:i,isStepPersistedInQueryString:n,key:r,startStep:o,stepQueryStringKey:h}){return{step:null,init(){this.step=this.getSteps().at(o-1),this.$watch("step",()=>{this.updateQueryString(),this.autofocusFields()}),this.autofocusFields(!0)},async requestNextStep(){await this.$wire.callSchemaComponentMethod(r,"nextStep",{currentStepIndex:this.getStepIndex(this.step)})},goToNextStep(){let t=this.getStepIndex(this.step)+1;t>=this.getSteps().length||(this.step=this.getSteps()[t],this.scroll())},goToPreviousStep(){let t=this.getStepIndex(this.step)-1;t<0||(this.step=this.getSteps()[t],this.scroll())},goToStep(t){let e=this.getStepIndex(t);e<=-1||!i&&e>this.getStepIndex(this.step)||(this.step=t,this.scroll())},scroll(){this.$nextTick(()=>{this.$refs.header?.children[this.getStepIndex(this.step)].scrollIntoView({behavior:"smooth",block:"start"})})},autofocusFields(t=!1){this.$nextTick(()=>{if(t&&document.activeElement&&document.activeElement!==document.body&&this.$el.compareDocumentPosition(document.activeElement)&Node.DOCUMENT_POSITION_PRECEDING)return;let e=this.$refs[`step-${this.step}`]?.querySelectorAll("[autofocus]")??[];for(let s of e)if(s.focus(),document.activeElement===s)break})},getStepIndex(t){let e=this.getSteps().findIndex(s=>s===t);return e===-1?0:e},getSteps(){return JSON.parse(this.$refs.stepsData.value)},isFirstStep(){return this.getStepIndex(this.step)<=0},isLastStep(){return this.getStepIndex(this.step)+1>=this.getSteps().length},isStepAccessible(t){return i||this.getStepIndex(this.step)>this.getStepIndex(t)},updateQueryString(){if(!n)return;let t=new URL(window.location.href);t.searchParams.set(h,this.step),history.replaceState(null,document.title,t.toString())}}}export{p as default};
|
||||
@@ -0,0 +1 @@
|
||||
(()=>{var o=()=>({isSticky:!1,width:0,resizeObserver:null,boundUpdateWidth:null,init(){let i=this.$el.parentElement;i&&(this.updateWidth(),this.resizeObserver=new ResizeObserver(()=>this.updateWidth()),this.resizeObserver.observe(i),this.boundUpdateWidth=this.updateWidth.bind(this),window.addEventListener("resize",this.boundUpdateWidth))},enableSticky(){this.isSticky=this.$el.getBoundingClientRect().top>0},disableSticky(){this.isSticky=!1},updateWidth(){let i=this.$el.parentElement;if(!i)return;let e=getComputedStyle(this.$root.querySelector(".fi-ac"));this.width=i.offsetWidth+parseInt(e.marginInlineStart,10)*-1+parseInt(e.marginInlineEnd,10)*-1},destroy(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.boundUpdateWidth&&(window.removeEventListener("resize",this.boundUpdateWidth),this.boundUpdateWidth=null)}});var a=function(i,e,n){let t=i;if(e.startsWith("/")&&(n=!0,e=e.slice(1)),n)return e;for(;e.startsWith("../");)t=t.includes(".")?t.slice(0,t.lastIndexOf(".")):null,e=e.slice(3);return["",null,void 0].includes(t)?e:["",null,void 0].includes(e)?t:`${t}.${e}`},d=i=>{let e=Alpine.findClosest(i,n=>n.__livewire);if(!e)throw"Could not find Livewire component in DOM tree.";return e.__livewire};document.addEventListener("alpine:init",()=>{window.Alpine.data("filamentSchema",({livewireId:i})=>({handleFormValidationError(e){e.detail.livewireId===i&&this.$nextTick(()=>{let n=this.$el.querySelector("[data-validation-error]");if(!n)return;let t=n;for(;t;)t.dispatchEvent(new CustomEvent("expand")),t=t.parentNode;setTimeout(()=>n.closest("[data-field-wrapper]").scrollIntoView({behavior:"smooth",block:"start",inline:"start"}),200)})},isStateChanged(e,n){if(e===void 0)return!1;try{return JSON.stringify(e)!==JSON.stringify(n)}catch{return e!==n}}})),window.Alpine.data("filamentSchemaComponent",({path:i,containerPath:e,$wire:n})=>({$statePath:i,$get:(t,r)=>n.$get(a(e,t,r)),$set:(t,r,s,l=!1)=>n.$set(a(e,t,s),r,l),get $state(){return n.$get(i)}})),window.Alpine.data("filamentActionsSchemaComponent",o),Livewire.interceptMessage(({message:i,onSuccess:e})=>{e(({payload:n})=>{n.effects?.dispatches?.forEach(t=>{if(!t.params?.awaitSchemaComponent)return;let r=Array.from(i.component.el.querySelectorAll(`[wire\\:partial="schema-component::${t.params.awaitSchemaComponent}"]`)).filter(s=>d(s)===i.component);if(r.length!==1){if(r.length>1)throw`Multiple schema components found with key [${t.params.awaitSchemaComponent}].`;window.addEventListener(`schema-component-${component.id}-${t.params.awaitSchemaComponent}-loaded`,()=>{window.dispatchEvent(new CustomEvent(t.name,{detail:t.params}))},{once:!0})}})})})});})();
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
function a({name:r,recordKey:s,state:n}){return{error:void 0,isLoading:!1,state:n,unsubscribeLivewireHook:null,init(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{t(()=>{this.$nextTick(()=>{if(this.isLoading||e.component.id!==this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value)return;let i=this.getServerState();i===void 0||Alpine.raw(this.state)===i||(this.state=i)})})}),this.$watch("state",async()=>{let e=this.getServerState();if(e===void 0||Alpine.raw(this.state)===e)return;this.isLoading=!0;let t=await this.$wire.updateTableColumnState(r,s,this.state);this.error=t?.error??void 0,!this.error&&this.$refs.serverState&&(this.$refs.serverState.value=this.state?"1":"0"),this.isLoading=!1})},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)},destroy(){this.unsubscribeLivewireHook?.()}}}export{a as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
function a({name:i,recordKey:s,state:n}){return{error:void 0,isLoading:!1,state:n,unsubscribeLivewireHook:null,init(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{t(()=>{this.$nextTick(()=>{if(this.isLoading||e.component.id!==this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value)return;let r=this.getServerState();r===void 0||this.getNormalizedState()===r||(this.state=r)})})}),this.$watch("state",async()=>{let e=this.getServerState();if(e===void 0||this.getNormalizedState()===e)return;this.isLoading=!0;let t=await this.$wire.updateTableColumnState(i,s,this.state);this.error=t?.error??void 0,!this.error&&this.$refs.serverState&&(this.$refs.serverState.value=this.getNormalizedState()),this.isLoading=!1})},getServerState(){if(this.$refs.serverState)return[null,void 0].includes(this.$refs.serverState.value)?"":this.$refs.serverState.value.replaceAll('\\"','"')},getNormalizedState(){let e=Alpine.raw(this.state);return[null,void 0].includes(e)?"":e},destroy(){this.unsubscribeLivewireHook?.()}}}export{a as default};
|
||||
@@ -0,0 +1 @@
|
||||
function a({name:r,recordKey:s,state:n}){return{error:void 0,isLoading:!1,state:n,unsubscribeLivewireHook:null,init(){this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:e,onSuccess:t})=>{t(()=>{this.$nextTick(()=>{if(this.isLoading||e.component.id!==this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value)return;let i=this.getServerState();i===void 0||Alpine.raw(this.state)===i||(this.state=i)})})}),this.$watch("state",async()=>{let e=this.getServerState();if(e===void 0||Alpine.raw(this.state)===e)return;this.isLoading=!0;let t=await this.$wire.updateTableColumnState(r,s,this.state);this.error=t?.error??void 0,!this.error&&this.$refs.serverState&&(this.$refs.serverState.value=this.state?"1":"0"),this.isLoading=!1})},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)},destroy(){this.unsubscribeLivewireHook?.()}}}export{a as default};
|
||||
File diff suppressed because one or more lines are too long
+186
-5
@@ -1,11 +1,192 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
@import url("https://fonts.bunny.net/css?family=Inter:400,500,600&display=swap");
|
||||
|
||||
[x-cloak] {
|
||||
display: none;
|
||||
@import 'tailwindcss';
|
||||
|
||||
@plugin "@tailwindcss/typography";
|
||||
|
||||
@theme {
|
||||
--font-sans: "Inter", sans-serif;
|
||||
}
|
||||
|
||||
@plugin "daisyui" {
|
||||
themes: light, dark --default --prefersdark;
|
||||
}
|
||||
|
||||
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
||||
|
||||
@plugin "daisyui/theme" {
|
||||
name: "dark";
|
||||
default: true;
|
||||
prefersdark: true;
|
||||
color-scheme: dark;
|
||||
|
||||
--animation-input: 0.15s;
|
||||
|
||||
--radius-selector: 0.15rem;
|
||||
--radius-field: 0.25rem;
|
||||
--radius-box: 0.5rem;
|
||||
|
||||
--size-selector: 0.25rem;
|
||||
--size-field: 0.25rem;
|
||||
|
||||
--color-primary: "#78716c";
|
||||
--color-primary-content: "#e3e1e0";
|
||||
--color-secondary: "#7a7a7a";
|
||||
--color-secondary-content: "#d1d1d5";
|
||||
--color-accent: "#8c9ae3";
|
||||
--color-accent-content: "#d3d4dd";
|
||||
--color-neutral: "#302f3c";
|
||||
--color-neutral-content: "#d1d1d5";
|
||||
--color-base-100: "#20202A";
|
||||
--color-base-200: "#1a1a23";
|
||||
--color-base-300: "#15151c";
|
||||
--color-base-content: "#cecdd0";
|
||||
--color-info: "#1e40af";
|
||||
--color-info-content: "#ced9f2";
|
||||
--color-success: "#166534";
|
||||
--color-success-content: "#d1dfd3";
|
||||
--color-warning: "#a16207";
|
||||
--color-warning-content: "#eddfd1";
|
||||
--color-error: "#991b1b";
|
||||
--color-error-content: "#efd3cf";
|
||||
--depth: 0;
|
||||
--noise: 0;
|
||||
}
|
||||
@plugin "daisyui/theme" {
|
||||
name: "light";
|
||||
prefersdark: false;
|
||||
color-scheme: light;
|
||||
|
||||
--animation-input: 0.15s;
|
||||
|
||||
--radius-selector: 0.15rem;
|
||||
--radius-field: 0.25rem;
|
||||
--radius-box: 0.5rem;
|
||||
|
||||
--size-selector: 0.25rem;
|
||||
--size-field: 0.25rem;
|
||||
|
||||
--color-primary: "#d6d3d1";
|
||||
--color-primary-content: "#101010";
|
||||
--color-secondary: "#9ca3af";
|
||||
--color-secondary-content: "#090a0b";
|
||||
--color-accent: "#525783";
|
||||
--color-accent-content: "#110c16";
|
||||
--color-neutral: "#6b7280";
|
||||
--color-neutral-content: "#e0e1e4";
|
||||
--color-base-100: "oklch(100% 0 0)";
|
||||
--color-base-200: "oklch(97.466% 0.011 259.822)";
|
||||
--color-base-300: "oklch(0.95 0.016 244.89)";
|
||||
--color-base-content: "#161616";
|
||||
--color-info: "#60a5fa";
|
||||
--color-info-content: "#030a15";
|
||||
--color-success: "#10b981";
|
||||
--color-success-content: "#000d06";
|
||||
--color-warning: "#fb923c";
|
||||
--color-warning-content: "#150801";
|
||||
--color-error: "#ef4444";
|
||||
--color-error-content: "#140202";
|
||||
--depth: 0;
|
||||
--noise: 0;
|
||||
}
|
||||
|
||||
/* Required by all components */
|
||||
@import '../../vendor/filament/support/resources/css/index.css';
|
||||
|
||||
/* Required by actions and tables */
|
||||
@import '../../vendor/filament/actions/resources/css/index.css';
|
||||
|
||||
/* Required by actions, forms and tables */
|
||||
@import '../../vendor/filament/forms/resources/css/index.css';
|
||||
|
||||
/* Required by actions, infolists, forms, schemas and tables */
|
||||
@import '../../vendor/filament/schemas/resources/css/index.css';
|
||||
|
||||
/* Required by tables */
|
||||
@import '../../vendor/filament/tables/resources/css/index.css';
|
||||
|
||||
|
||||
@source "../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php";
|
||||
@source "../../storage/framework/views/*.php";
|
||||
@source "../**/*.blade.php";
|
||||
|
||||
/* table overrides */
|
||||
.fi-ta-ctn {
|
||||
@apply bg-transparent rounded-none border-none ring-0 shadow-none;
|
||||
|
||||
& table.fi-ta-table thead tr {
|
||||
@apply bg-transparent;
|
||||
}
|
||||
|
||||
& table.fi-ta-table thead tr th.fi-ta-header-cell {
|
||||
color: color-mix(in oklab,var(--color-base-content)60%,transparent) !important;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .05rem;
|
||||
font-size: .725rem;
|
||||
font-weight: normal;
|
||||
|
||||
& .fi-icon {
|
||||
color: color-mix(in oklab,var(--color-base-content)60%,transparent) !important;
|
||||
}
|
||||
}
|
||||
|
||||
& table.fi-ta-table .fi-clickable:hover {
|
||||
background-color: color-mix(in oklab,var(--color-base-200)50%,transparent) !important;
|
||||
}
|
||||
& [data-theme=dark] table.fi-ta-table .fi-clickable:hover {
|
||||
background-color: var(--color-base-100);
|
||||
}
|
||||
|
||||
& ol.fi-pagination-items {
|
||||
& .fi-pagination-item-label {
|
||||
color: var(--color-base-content);
|
||||
}
|
||||
}
|
||||
|
||||
& td.fi-ta-cell div.fi-ta-text {
|
||||
color: var(--color-base-content);
|
||||
}
|
||||
|
||||
& table.fi-ta-table.fi-ta-table-stacked-on-mobile td {
|
||||
padding-block: 0;
|
||||
}
|
||||
|
||||
& .fi-ta-header-toolbar {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Tool tip for apex charts */
|
||||
[data-theme=dark] .apexcharts-tooltip-title {
|
||||
background: #292933 !important;
|
||||
border-bottom: 1px solid #393939 !important;
|
||||
}
|
||||
[data-theme=dark] .apexcharts-tooltip {
|
||||
background: #20202A !important;
|
||||
border-color: #393939 !important;
|
||||
}
|
||||
|
||||
/* Wiggle animation */
|
||||
@keyframes wiggle {
|
||||
10%, 90% {
|
||||
transform: translate3d(-1px, 0, 0);
|
||||
}
|
||||
20%, 80% {
|
||||
transform: translate3d(2px, 0, 0);
|
||||
}
|
||||
30%, 50%, 70% {
|
||||
transform: translate3d(-4px, 0, 0);
|
||||
}
|
||||
40%, 60% {
|
||||
transform: translate3d(4px, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.wiggle {
|
||||
animation: wiggle 0.5s cubic-bezier(.36,.07,.19,.97) both;
|
||||
}
|
||||
|
||||
/* AI chat styles */
|
||||
.ai-chat ul, .ai-chat ol, .ai-chat ol li > ul {
|
||||
margin-left: 1.1rem;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,195 @@
|
||||
<div>
|
||||
<!-- Generate API Token -->
|
||||
<?php
|
||||
|
||||
use App\Traits\Toast;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Livewire\Volt\Component;
|
||||
|
||||
new class extends Component
|
||||
{
|
||||
use Toast;
|
||||
|
||||
/**
|
||||
* The create API token form state.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $createApiTokenForm = [
|
||||
'name' => '',
|
||||
'permissions' => [],
|
||||
];
|
||||
|
||||
/**
|
||||
* Indicates if the plain text token is being displayed to the user.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $displayingToken = false;
|
||||
|
||||
/**
|
||||
* The plain text token value.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $plainTextToken;
|
||||
|
||||
/**
|
||||
* Indicates if the user is currently managing an API token's permissions.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $managingApiTokenPermissions = false;
|
||||
|
||||
/**
|
||||
* The token that is currently having its permissions managed.
|
||||
*
|
||||
* @var \Laravel\Sanctum\PersonalAccessToken|null
|
||||
*/
|
||||
public $managingPermissionsFor;
|
||||
|
||||
/**
|
||||
* The update API token form state.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $updateApiTokenForm = [
|
||||
'permissions' => [],
|
||||
];
|
||||
|
||||
/**
|
||||
* Indicates if the application is confirming if an API token should be deleted.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $confirmingApiTokenDeletion = false;
|
||||
|
||||
/**
|
||||
* The ID of the API token being deleted.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $apiTokenIdBeingDeleted;
|
||||
|
||||
/**
|
||||
* Mount the component.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function mount()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new API token.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function createApiToken()
|
||||
{
|
||||
$this->resetErrorBag();
|
||||
|
||||
Validator::make([
|
||||
'name' => $this->createApiTokenForm['name'],
|
||||
], [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
])->validateWithBag('createApiToken');
|
||||
|
||||
$this->displayTokenValue($this->user->createToken(
|
||||
$this->createApiTokenForm['name']
|
||||
));
|
||||
|
||||
$this->createApiTokenForm['name'] = '';
|
||||
|
||||
$this->dispatch('created');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the token value to the user.
|
||||
*
|
||||
* @param \Laravel\Sanctum\NewAccessToken $token
|
||||
* @return void
|
||||
*/
|
||||
protected function displayTokenValue($token)
|
||||
{
|
||||
$this->displayingToken = true;
|
||||
|
||||
$this->plainTextToken = explode('|', $token->plainTextToken, 2)[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow the given token's permissions to be managed.
|
||||
*
|
||||
* @param int $tokenId
|
||||
* @return void
|
||||
*/
|
||||
public function manageApiTokenPermissions($tokenId)
|
||||
{
|
||||
$this->managingApiTokenPermissions = true;
|
||||
|
||||
$this->managingPermissionsFor = $this->user->tokens()->where(
|
||||
'id', $tokenId
|
||||
)->firstOrFail();
|
||||
|
||||
$this->updateApiTokenForm['permissions'] = $this->managingPermissionsFor->abilities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the API token's permissions.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateApiToken()
|
||||
{
|
||||
$this->managingPermissionsFor->forceFill([
|
||||
'abilities' => [],
|
||||
])->save();
|
||||
|
||||
$this->managingApiTokenPermissions = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm that the given API token should be deleted.
|
||||
*
|
||||
* @param int $tokenId
|
||||
* @return void
|
||||
*/
|
||||
public function confirmApiTokenDeletion($tokenId)
|
||||
{
|
||||
$this->confirmingApiTokenDeletion = true;
|
||||
|
||||
$this->apiTokenIdBeingDeleted = $tokenId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the API token.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteApiToken()
|
||||
{
|
||||
$this->user->tokens()->where('id', $this->apiTokenIdBeingDeleted)->first()->delete();
|
||||
|
||||
$this->user->load('tokens');
|
||||
|
||||
$this->confirmingApiTokenDeletion = false;
|
||||
|
||||
$this->managingPermissionsFor = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current user of the application.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUserProperty()
|
||||
{
|
||||
return Auth::user();
|
||||
}
|
||||
}; ?>
|
||||
|
||||
<div x-data>
|
||||
{{-- Generate API Token --}}
|
||||
<x-forms.form-section submit="createApiToken">
|
||||
<x-slot name="title">
|
||||
{{ __('Create API Token') }}
|
||||
@@ -10,13 +200,13 @@
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="form">
|
||||
<!-- Token Name -->
|
||||
{{-- Token Name --}}
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<x-input id="name" label="{{ __('Token Name') }}" type="text" class="mt-1 block w-full" wire:model="createApiTokenForm.name" autofocus />
|
||||
<x-ui.input id="name" label="{{ __('Token Name') }}" type="text" class="mt-1 block w-full" wire:model="createApiTokenForm.name" autofocus />
|
||||
</div>
|
||||
|
||||
<!-- Token Permissions -->
|
||||
@if (Laravel\Jetstream\Jetstream::hasPermissions())
|
||||
{{-- Token Permissions --}}
|
||||
@if (false)
|
||||
<div class="col-span-6">
|
||||
<label class="pt-0 label label-text font-semibold">
|
||||
<span>
|
||||
@@ -25,15 +215,63 @@
|
||||
</span>
|
||||
|
||||
<div class="mt-2 grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@foreach (Laravel\Jetstream\Jetstream::$permissions as $label => $permission)
|
||||
@foreach ([] as $label => $permission)
|
||||
<label class="flex items-center">
|
||||
<x-checkbox wire:model="createApiTokenForm.permissions" :value="$permission"/>
|
||||
<x-ui.checkbox wire:model="createApiTokenForm.permissions" :value="$permission"/>
|
||||
<span class="ms-2 text-sm text-gray-600 dark:text-gray-400">{{ $label }}</span>
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Token Value Modal --}}
|
||||
<x-ui.modal
|
||||
persistent
|
||||
key="token-display-modal"
|
||||
wire:model.live="displayingToken"
|
||||
title="{{ __('API Token') }}"
|
||||
>
|
||||
<div class="mt-2 text-sm text-secondary-content">
|
||||
|
||||
<div class="mb-4">
|
||||
{{ __('Please copy your new API token. For your security, it won\'t be shown again.') }}
|
||||
</div>
|
||||
|
||||
<x-ui.input
|
||||
x-ref="plaintextToken"
|
||||
type="text"
|
||||
readonly
|
||||
:value="$plainTextToken"
|
||||
class="font-mono break-all focus:outline-none focus:ring-0"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
spellcheck="false"
|
||||
>
|
||||
<x-slot:suffix>
|
||||
<x-ui.button
|
||||
title="{{ __('Copy to clipboard') }}"
|
||||
class="btn-circle btn-sm btn-ghost me-2"
|
||||
icon="o-clipboard"
|
||||
@click="
|
||||
navigator.clipboard.writeText($wire.plainTextToken);
|
||||
$wire.$set('displayingToken', false);
|
||||
$wire.success('{{ __('Successfully copied!') }}')
|
||||
"
|
||||
/>
|
||||
</x-slot:suffix>
|
||||
</x-ui.input>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-end mt-8 text-end">
|
||||
<x-ui.button class="btn-outline" wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
|
||||
{{ __('Close') }}
|
||||
</x-ui.button>
|
||||
</div>
|
||||
|
||||
</x-ui.modal>
|
||||
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="actions">
|
||||
@@ -41,16 +279,16 @@
|
||||
{{ __('Created.') }}
|
||||
</x-forms.action-message>
|
||||
|
||||
<x-button type="submit">
|
||||
<x-ui.button type="submit">
|
||||
{{ __('Create') }}
|
||||
</x-button>
|
||||
</x-ui.button>
|
||||
</x-slot>
|
||||
</x-forms.form-section>
|
||||
|
||||
@if ($this->user->tokens->isNotEmpty())
|
||||
<x-section-border hide-on-mobile />
|
||||
<x-ui.section-border hide-on-mobile />
|
||||
|
||||
<!-- Manage API Tokens -->
|
||||
{{-- Manage API Tokens --}}
|
||||
<div class="mt-10 sm:mt-0">
|
||||
<x-forms.action-section>
|
||||
<x-slot name="title">
|
||||
@@ -61,12 +299,12 @@
|
||||
{{ __('You may delete any of your existing tokens if they are no longer needed.') }}
|
||||
</x-slot>
|
||||
|
||||
<!-- API Token List -->
|
||||
{{-- API Token List --}}
|
||||
<x-slot name="content">
|
||||
<div class="space-y-6">
|
||||
@foreach ($this->user->tokens->sortBy('name') as $token)
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="break-all dark:text-white">
|
||||
<div class="break-all">
|
||||
{{ $token->name }}
|
||||
</div>
|
||||
|
||||
@@ -77,7 +315,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (Laravel\Jetstream\Jetstream::hasPermissions())
|
||||
@if (false)
|
||||
<button class="cursor-pointer ms-6 text-sm text-gray-400 underline" wire:click="manageApiTokenPermissions({{ $token->id }})">
|
||||
{{ __('Permissions') }}
|
||||
</button>
|
||||
@@ -95,42 +333,17 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Token Value Modal -->
|
||||
<x-dialog-modal wire:model.live="displayingToken">
|
||||
<x-slot name="title">
|
||||
{{ __('API Token') }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<div>
|
||||
{{ __('Please copy your new API token. For your security, it won\'t be shown again.') }}
|
||||
</div>
|
||||
|
||||
<x-input x-ref="plaintextToken" type="text" readonly :value="$plainTextToken"
|
||||
class="mt-4 px-4 py-2 rounded font-mono text-sm w-full break-all"
|
||||
autofocus autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
@showing-token-modal.window="setTimeout(() => $refs.plaintextToken.select(), 250)"
|
||||
/>
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="footer">
|
||||
<x-button class="btn-outline" wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
|
||||
{{ __('Close') }}
|
||||
</x-button>
|
||||
</x-slot>
|
||||
</x-dialog-modal>
|
||||
|
||||
<!-- API Token Permissions Modal -->
|
||||
<x-dialog-modal wire:model.live="managingApiTokenPermissions">
|
||||
{{-- API Token Permissions Modal --}}
|
||||
<x-ui.dialog-modal key="manage-permission-modal" wire:model.live="managingApiTokenPermissions">
|
||||
<x-slot name="title">
|
||||
{{ __('API Token Permissions') }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@foreach (Laravel\Jetstream\Jetstream::$permissions as $label => $permission)
|
||||
@foreach ([] as $label => $permission)
|
||||
<label class="flex items-center">
|
||||
<x-checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
|
||||
<x-ui.checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
|
||||
<span class="ms-2 text-sm text-gray-600 dark:text-gray-400">{{ $label }}</span>
|
||||
</label>
|
||||
@endforeach
|
||||
@@ -138,18 +351,18 @@
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="footer">
|
||||
<x-button class="btn-outline" wire:click="$set('managingApiTokenPermissions', false)" wire:loading.attr="disabled">
|
||||
<x-ui.button class="btn-outline" wire:click="$set('managingApiTokenPermissions', false)" wire:loading.attr="disabled">
|
||||
{{ __('Cancel') }}
|
||||
</x-button>
|
||||
</x-ui.button>
|
||||
|
||||
<x-button type="submit" class="ms-3" wire:click="updateApiToken" wire:loading.attr="disabled">
|
||||
<x-ui.button type="submit" class="ms-3" wire:click="updateApiToken" wire:loading.attr="disabled">
|
||||
{{ __('Save') }}
|
||||
</x-button>
|
||||
</x-ui.button>
|
||||
</x-slot>
|
||||
</x-dialog-modal>
|
||||
</x-ui.dialog-modal>
|
||||
|
||||
<!-- Delete Token Confirmation Modal -->
|
||||
<x-confirmation-modal wire:model.live="confirmingApiTokenDeletion">
|
||||
{{-- Delete Token Confirmation Modal --}}
|
||||
<x-ui.confirmation-modal key="confirm-deletion-modal" wire:model.live="confirmingApiTokenDeletion">
|
||||
<x-slot name="title">
|
||||
{{ __('Delete API Token') }}
|
||||
</x-slot>
|
||||
@@ -159,13 +372,13 @@
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="footer">
|
||||
<x-button class="btn-outline" wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.attr="disabled">
|
||||
<x-ui.button class="btn-outline" wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.attr="disabled">
|
||||
{{ __('Cancel') }}
|
||||
</x-button>
|
||||
</x-ui.button>
|
||||
|
||||
<x-button class="ms-3 btn-error text-white" wire:click="deleteApiToken" wire:loading.attr="disabled">
|
||||
<x-ui.button class="ms-3 btn-error text-white" wire:click="deleteApiToken" wire:loading.attr="disabled">
|
||||
{{ __('Delete') }}
|
||||
</x-button>
|
||||
</x-ui.button>
|
||||
</x-slot>
|
||||
</x-confirmation-modal>
|
||||
</x-ui.confirmation-modal>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
||||
{{ __('API Tokens') }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
<x-layouts.app>
|
||||
|
||||
<div>
|
||||
<div class="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">
|
||||
@livewire('api.api-token-manager')
|
||||
</div>
|
||||
<div class="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">
|
||||
@livewire('api-token-manager')
|
||||
</div>
|
||||
</x-app-layout>
|
||||
|
||||
</x-layouts.app>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<x-guest-layout>
|
||||
<x-authentication-card>
|
||||
<x-layouts.guest>
|
||||
<x-ui.authentication-card>
|
||||
<x-slot name="logo">
|
||||
<div class="w-24 mb-10">
|
||||
<x-glyph-only-logo />
|
||||
<x-ui.logo />
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
@@ -10,20 +10,20 @@
|
||||
{{ __('This is a secure area of the application. Please confirm your password before continuing.') }}
|
||||
</div>
|
||||
|
||||
<x-errors class="mb-4" />
|
||||
<x-ui.errors class="mb-4" />
|
||||
|
||||
<form method="POST" action="{{ route('password.confirm') }}">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<x-input id="password" label="{{ __('Password') }}" class="block mt-1 w-full" type="password" name="password" required autocomplete="current-password" autofocus />
|
||||
<x-ui.input id="password" label="{{ __('Password') }}" class="block mt-1 w-full" type="password" name="password" required autocomplete="current-password" autofocus />
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end mt-4">
|
||||
<x-button type="submit" class="btn-primary ms-4">
|
||||
<x-ui.button type="submit" class="btn-primary ms-4">
|
||||
{{ __('Confirm') }}
|
||||
</x-button>
|
||||
</x-ui.button>
|
||||
</div>
|
||||
</form>
|
||||
</x-authentication-card>
|
||||
</x-guest-layout>
|
||||
</x-ui.authentication-card>
|
||||
</x-layouts.guest>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user