Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Laravel Boost guidelines are specifically curated by Laravel maintainers for
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.14
- filament/filament (FILAMENT) - v3
- filament/filament (FILAMENT) - v4
- laravel/framework (LARAVEL) - v12
- laravel/prompts (PROMPTS) - v0
- laravel/sanctum (SANCTUM) - v4
Expand Down Expand Up @@ -196,19 +196,25 @@ Forms\Components\Select::make('user_id')
</code-snippet>


=== filament/v3 rules ===
=== filament/v4 rules ===

## Filament 3
## Filament 4

## Version 3 Changes To Focus On
- Resources are located in `app/Filament/Resources/` directory.
- Resource pages (List, Create, Edit) are auto-generated within the resource's directory - e.g., `app/Filament/Resources/PostResource/Pages/`.
- Forms use the `Forms\Components` namespace for form fields.
- Tables use the `Tables\Columns` namespace for table columns.
- A new `Filament\Forms\Components\RichEditor` component is available.
- Form and table schemas now use fluent method chaining.
- Added `php artisan filament:optimize` command for production optimization.
- Requires implementing `FilamentUser` contract for production access control.
### Important Version 4 Changes
- File visibility is now `private` by default.
- The `deferFilters` method from Filament v3 is now the default behavior in Filament v4, so users must click a button before the filters are applied to the table. To disable this behavior, you can use the `deferFilters(false)` method.
- The `Grid`, `Section`, and `Fieldset` layout components no longer span all columns by default.
- The `all` pagination page method is not available for tables by default.
- All action classes extend `Filament\Actions\Action`. No action classes exist in `Filament\Tables\Actions`.
- The `Form` & `Infolist` layout components have been moved to `Filament\Schemas\Components`, for example `Grid`, `Section`, `Fieldset`, `Tabs`, `Wizard`, etc.
- A new `Repeater` component for Forms has been added.
- Icons now use the `Filament\Support\Icons\Heroicon` Enum by default. Other options are available and documented.

### Organize Component Classes Structure
- Schema components: `Schemas/Components/`
- Table columns: `Tables/Columns/`
- Table filters: `Tables/Filters/`
- Actions: `Actions/`


=== laravel/core rules ===
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress

- name: Generate OpenAPI JSON
run: ./vendor/bin/openapi app -o openapi_temp.json -f json
run: ./vendor/bin/openapi ./app/Http/Controllers/Api ./app/OpenApi -o openapi_temp.json -f json

- name: Commit OpenAPI JSON if changed
run: |
Expand Down
35 changes: 18 additions & 17 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Laravel Boost guidelines are specifically curated by Laravel maintainers for
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.14
- filament/filament (FILAMENT) - v3
- filament/filament (FILAMENT) - v4
- laravel/framework (LARAVEL) - v12
- laravel/prompts (PROMPTS) - v0
- laravel/sanctum (SANCTUM) - v4
Expand All @@ -27,11 +27,6 @@ This application is a Laravel application and its main Laravel ecosystems packag
- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`.
- Check for existing components to reuse before writing a new one.

## Final Steps After All AI Work
- **CRITICAL**: You must ALWAYS run `./vendor/bin/pint --dirty` after completing ALL code changes, edits, or additions. This ensures all PHP code matches the project's expected formatting style.
- This is a mandatory final step for every task that involves PHP code modifications.
- Run Pint before considering any work complete.

## 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.

Expand Down Expand Up @@ -201,19 +196,25 @@ Forms\Components\Select::make('user_id')
</code-snippet>


=== filament/v3 rules ===
=== filament/v4 rules ===

## Filament 4

## Filament 3
### Important Version 4 Changes
- File visibility is now `private` by default.
- The `deferFilters` method from Filament v3 is now the default behavior in Filament v4, so users must click a button before the filters are applied to the table. To disable this behavior, you can use the `deferFilters(false)` method.
- The `Grid`, `Section`, and `Fieldset` layout components no longer span all columns by default.
- The `all` pagination page method is not available for tables by default.
- All action classes extend `Filament\Actions\Action`. No action classes exist in `Filament\Tables\Actions`.
- The `Form` & `Infolist` layout components have been moved to `Filament\Schemas\Components`, for example `Grid`, `Section`, `Fieldset`, `Tabs`, `Wizard`, etc.
- A new `Repeater` component for Forms has been added.
- Icons now use the `Filament\Support\Icons\Heroicon` Enum by default. Other options are available and documented.

## Version 3 Changes To Focus On
- Resources are located in `app/Filament/Resources/` directory.
- Resource pages (List, Create, Edit) are auto-generated within the resource's directory - e.g., `app/Filament/Resources/PostResource/Pages/`.
- Forms use the `Forms\Components` namespace for form fields.
- Tables use the `Tables\Columns` namespace for table columns.
- A new `Filament\Forms\Components\RichEditor` component is available.
- Form and table schemas now use fluent method chaining.
- Added `php artisan filament:optimize` command for production optimization.
- Requires implementing `FilamentUser` contract for production access control.
### Organize Component Classes Structure
- Schema components: `Schemas/Components/`
- Table columns: `Tables/Columns/`
- Table filters: `Tables/Filters/`
- Actions: `Actions/`


=== laravel/core rules ===
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Pages/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

class Dashboard extends BasePage
{
protected static ?string $navigationIcon = 'heroicon-o-chart-bar';
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-chart-bar';

protected static string $view = 'filament.pages.dashboard';
protected string $view = 'filament.pages.dashboard';

public function getSubheading(): ?string
{
Expand Down
130 changes: 130 additions & 0 deletions app/Filament/Pages/Settings/DataIntegration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?php

namespace App\Filament\Pages\Settings;

use App\Jobs\Influxdb\v2\BulkWriteResults;
use App\Jobs\Influxdb\v2\TestConnectionJob;
use App\Settings\DataIntegrationSettings;
use Filament\Actions\Action;
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Notifications\Notification;
use Filament\Pages\SettingsPage;
use Filament\Schemas\Components\Actions;
use Filament\Schemas\Components\Grid;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Schema;
use Illuminate\Support\Facades\Auth;

class DataIntegration extends SettingsPage
{
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-circle-stack';

protected static string|\UnitEnum|null $navigationGroup = 'Settings';

protected static ?int $navigationSort = 2;

protected static ?string $title = 'Data Integration';

protected static ?string $navigationLabel = 'Data Integration';

protected static string $settings = DataIntegrationSettings::class;

public static function canAccess(): bool
{
return Auth::check() && Auth::user()->is_admin;
}

public static function shouldRegisterNavigation(): bool
{
return Auth::check() && Auth::user()->is_admin;
}

public function form(Schema $schema): Schema
{
return $schema
->components([
Grid::make([
'default' => 1,
'md' => 3,
])
->schema([
Section::make('InfluxDB v2')
->description('When enabled, all new Speedtest results will also be sent to InfluxDB.')
->schema([
Toggle::make('influxdb_v2_enabled')
->label('Enable')
->reactive()
->columnSpanFull(),
Grid::make(['default' => 1, 'md' => 3])
->hidden(fn (Get $get) => $get('influxdb_v2_enabled') !== true)
->schema([
TextInput::make('influxdb_v2_url')
->label('URL')
->placeholder('http://your-influxdb-instance')
->maxLength(255)
->required(fn (Get $get) => $get('influxdb_v2_enabled') === true)
->columnSpan(['md' => 1]),
TextInput::make('influxdb_v2_org')
->label('Org')
->maxLength(255)
->required(fn (Get $get) => $get('influxdb_v2_enabled') === true)
->columnSpan(['md' => 1]),
TextInput::make('influxdb_v2_bucket')
->placeholder('speedtest-tracker')
->label('Bucket')
->maxLength(255)
->required(fn (Get $get) => $get('influxdb_v2_enabled') === true)
->columnSpan(['md' => 2]),
TextInput::make('influxdb_v2_token')
->label('Token')
->maxLength(255)
->password()
->required(fn (Get $get) => $get('influxdb_v2_enabled') === true)
->columnSpan(['md' => 2]),
Checkbox::make('influxdb_v2_verify_ssl')
->label('Verify SSL')
->columnSpanFull(),
// Button to send old data to InfluxDB
Actions::make([
Action::make('Export current results')
->label('Export current results')
->action(function () {
Notification::make()
->title('Starting bulk data write to Influxdb')
->info()
->send();

BulkWriteResults::dispatch(Auth::user());
})
->color('primary')
->icon('heroicon-o-cloud-arrow-up')
->visible(fn (): bool => app(DataIntegrationSettings::class)->influxdb_v2_enabled),
]),
// Button to test InfluxDB connection
Actions::make([
Action::make('Test connection')
->label('Test connection')
->action(function () {
Notification::make()
->title('Sending test data to Influxdb')
->info()
->send();

TestConnectionJob::dispatch(Auth::user());
})
->color('primary')
->icon('heroicon-o-check-circle')
->visible(fn (): bool => app(DataIntegrationSettings::class)->influxdb_v2_enabled),
]),
]),
])
->compact()
->columnSpanFull(),
])
->columnSpanFull(),
]);
}
}
136 changes: 0 additions & 136 deletions app/Filament/Pages/Settings/DataIntegrationPage.php

This file was deleted.

Loading