Skip to content
Draft
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
23 changes: 2 additions & 21 deletions .claude/skills/filament-panel-setup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ Add a `->discoverResources()` call per module in `CompanyPanelProvider`:
The `in` path is a filesystem path, `for` is the PHP namespace prefix. Both must
match the module's actual directory and namespace exactly.

## viteTheme Guard

`->viteTheme()` calls `app(Vite::class)($theme)` which reads `public/build/manifest.json`.
In test environments there is no built manifest, so wrap it:

```php
->when(
! app()->runningUnitTests(),
fn (Panel $panel) => $panel->viteTheme('resources/css/filament/company/nord.css')
)
```

`app()->runningUnitTests()` returns `true` when `APP_ENV=testing` (set in `phpunit.xml`).

## Tenant Panel Required Config

```php
Expand All @@ -65,13 +51,8 @@ In test environments there is no built manifest, so wrap it:

## Colors and Font

Both panels use:
```php
->colors(['primary' => Color::hex('#88c0d0')])
```

Company panel: `Poppins` via `GoogleFontProvider`
Admin panel: `Albert Sans` via `GoogleFontProvider`
All three panels use Filament's stock default color palette (no custom `->colors()` override,
no custom `->viteTheme()`) and `Poppins` via `GoogleFontProvider`.

## SPA Mode

Expand Down
226 changes: 0 additions & 226 deletions .github/THEMES.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
use Modules\Clients\Filament\Company\Resources\Relations\RelationResource;
use Modules\Clients\Services\RelationService;

class ListRelations extends ListRecords
{
Expand All @@ -15,13 +14,7 @@ protected function getHeaderActions(): array
{
return [
CreateAction::make()
->mutateDataUsing(function (array $data) {
return $data;
})
->action(function (array $data) {
app(RelationService::class)->createRelation($data);
})
->modalWidth('full'),
->url(fn (): string => RelationResource::getUrl('create')),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ protected function getHeaderActions(): array
'customer_id' => $this->getRecord()->id,
])),

EditAction::make(),
EditAction::make()
->url(fn (): string => RelationResource::getUrl('edit', [
'record' => $this->getRecord(),
])),

DeleteAction::make()
->hidden(fn () => $this->getRecord()->hasLinkedRecords())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Illuminate\Database\Eloquent\Model;
use Modules\Clients\Enums\RelationStatus;
use Modules\Clients\Enums\RelationType;
use Modules\Clients\Filament\Company\Resources\Relations\Pages\CreateRelation;
use Modules\Clients\Filament\Company\Resources\Relations\Pages\EditRelation;
use Modules\Clients\Filament\Company\Resources\Relations\Pages\ListRelations;
use Modules\Clients\Filament\Company\Resources\Relations\Pages\ViewRelation;
use Modules\Clients\Filament\Company\Resources\Relations\RelationManagers\ExpensesRelationManager;
Expand Down Expand Up @@ -84,8 +86,10 @@ public static function getRelations(): array
public static function getPages(): array
{
return [
'index' => ListRelations::route('/'),
'view' => ViewRelation::route('/{record}'),
'index' => ListRelations::route('/'),
'create' => CreateRelation::route('/create'),
'view' => ViewRelation::route('/{record}'),
'edit' => EditRelation::route('/{record}/edit'),
];
}

Expand Down
Loading