Skip to content

Commit f0d34d1

Browse files
committed
wip
1 parent e414aff commit f0d34d1

File tree

84 files changed

+1699
-1404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1699
-1404
lines changed

.ai/mcp/mcp.json

Whitespace-only changes.

.junie/guidelines.md

Lines changed: 14 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ This application is a Laravel application and its main Laravel ecosystems packag
2222
- alpinejs (ALPINEJS) - v3
2323
- tailwindcss (TAILWINDCSS) - v4
2424

25-
2625
## Conventions
2726
- 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, naming.
2827
- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`.
@@ -114,116 +113,20 @@ protected function isAccessible(User $user, ?string $path = null): bool
114113
- That being said, keys in an Enum should follow existing application Enum conventions.
115114

116115

117-
=== filament/core rules ===
118-
119-
## Filament
120-
- Filament is used by this application, check how and where to follow existing application conventions.
121-
- Filament is a Server-Driven UI (SDUI) framework for Laravel. It allows developers to define user interfaces in PHP using structured configuration objects. It is built on top of Livewire, Alpine.js, and Tailwind CSS.
122-
- You can use the `search-docs` tool to get information from the official Filament documentation when needed. This is very useful for Artisan command arguments, specific code examples, testing functionality, relationship management, and ensuring you're following idiomatic practices.
123-
- Utilize static `make()` methods for consistent component initialization.
124-
125-
### Artisan
126-
- You must use the Filament specific Artisan commands to create new files or components for Filament. You can find these with the `list-artisan-commands` tool, or with `php artisan` and the `--help` option.
127-
- Inspect the required options, always pass `--no-interaction`, and valid arguments for other options when applicable.
128-
129-
### Filament's Core Features
130-
- Actions: Handle doing something within the application, often with a button or link. Actions encapsulate the UI, the interactive modal window, and the logic that should be executed when the modal window is submitted. They can be used anywhere in the UI and are commonly used to perform one-time actions like deleting a record, sending an email, or updating data in the database based on modal form input.
131-
- Forms: Dynamic forms rendered within other features, such as resources, action modals, table filters, and more.
132-
- Infolists: Read-only lists of data.
133-
- Notifications: Flash notifications displayed to users within the application.
134-
- Panels: The top-level container in Filament that can include all other features like pages, resources, forms, tables, notifications, actions, infolists, and widgets.
135-
- Resources: Static classes that are used to build CRUD interfaces for Eloquent models. Typically live in `app/Filament/Resources`.
136-
- Schemas: Represent components that define the structure and behavior of the UI, such as forms, tables, or lists.
137-
- Tables: Interactive tables with filtering, sorting, pagination, and more.
138-
- Widgets: Small component included within dashboards, often used for displaying data in charts, tables, or as a stat.
139-
140-
### Relationships
141-
- Determine if you can use the `relationship()` method on form components when you need `options` for a select, checkbox, repeater, or when building a `Fieldset`:
142-
143-
<code-snippet name="Relationship example for Form Select" lang="php">
144-
Forms\Components\Select::make('user_id')
145-
->label('Author')
146-
->relationship('author')
147-
->required(),
148-
</code-snippet>
149-
150-
151-
## Testing
152-
- It's important to test Filament functionality for user satisfaction.
153-
- Ensure that you are authenticated to access the application within the test.
154-
- Filament uses Livewire, so start assertions with `livewire()` or `Livewire::test()`.
155-
156-
### Example Tests
157-
158-
<code-snippet name="Filament Table Test" lang="php">
159-
livewire(ListUsers::class)
160-
->assertCanSeeTableRecords($users)
161-
->searchTable($users->first()->name)
162-
->assertCanSeeTableRecords($users->take(1))
163-
->assertCanNotSeeTableRecords($users->skip(1))
164-
->searchTable($users->last()->email)
165-
->assertCanSeeTableRecords($users->take(-1))
166-
->assertCanNotSeeTableRecords($users->take($users->count() - 1));
167-
</code-snippet>
168-
169-
<code-snippet name="Filament Create Resource Test" lang="php">
170-
livewire(CreateUser::class)
171-
->fillForm([
172-
'name' => 'Howdy',
173-
'email' => 'howdy@example.com',
174-
])
175-
->call('create')
176-
->assertNotified()
177-
->assertRedirect();
178-
179-
assertDatabaseHas(User::class, [
180-
'name' => 'Howdy',
181-
'email' => 'howdy@example.com',
182-
]);
183-
</code-snippet>
184-
185-
<code-snippet name="Testing Multiple Panels (setup())" lang="php">
186-
use Filament\Facades\Filament;
187-
188-
Filament::setCurrentPanel('app');
189-
</code-snippet>
190-
191-
<code-snippet name="Calling an Action in a Test" lang="php">
192-
livewire(EditInvoice::class, [
193-
'invoice' => $invoice,
194-
])->callAction('send');
195-
196-
expect($invoice->refresh())->isSent()->toBeTrue();
197-
</code-snippet>
198-
199-
200-
=== filament/v4 rules ===
201-
202-
## Filament 4
116+
=== tests rules ===
203117

204-
### Important Version 4 Changes
205-
- File visibility is now `private` by default.
206-
- 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.
207-
- The `Grid`, `Section`, and `Fieldset` layout components no longer span all columns by default.
208-
- The `all` pagination page method is not available for tables by default.
209-
- All action classes extend `Filament\Actions\Action`. No action classes exist in `Filament\Tables\Actions`.
210-
- The `Form` & `Infolist` layout components have been moved to `Filament\Schemas\Components`, for example `Grid`, `Section`, `Fieldset`, `Tabs`, `Wizard`, etc.
211-
- A new `Repeater` component for Forms has been added.
212-
- Icons now use the `Filament\Support\Icons\Heroicon` Enum by default. Other options are available and documented.
118+
## Test Enforcement
213119

214-
### Organize Component Classes Structure
215-
- Schema components: `Schemas/Components/`
216-
- Table columns: `Tables/Columns/`
217-
- Table filters: `Tables/Filters/`
218-
- Actions: `Actions/`
120+
- 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.
121+
- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test` with a specific filename or filter.
219122

220123

221124
=== laravel/core rules ===
222125

223126
## Do Things the Laravel Way
224127

225128
- 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.
226-
- If you're creating a generic PHP class, use `artisan make:class`.
129+
- If you're creating a generic PHP class, use `php artisan make:class`.
227130
- 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.
228131

229132
### Database
@@ -258,7 +161,7 @@ Forms\Components\Select::make('user_id')
258161
### Testing
259162
- 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.
260163
- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`.
261-
- 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.
164+
- 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.
262165

263166
### Vite Error
264167
- 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`.
@@ -374,12 +277,11 @@ document.addEventListener('livewire:init', function () {
374277
=== pest/core rules ===
375278
376279
## Pest
377-
378280
### Testing
379281
- If you need to verify a feature is working, write or update a Unit / Feature test.
380282
381283
### Pest Tests
382-
- All tests must be written using Pest. Use `php artisan make:test --pest <name>`.
284+
- All tests must be written using Pest. Use `php artisan make:test --pest {name}`.
383285
- 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.
384286
- Tests should test all of the happy paths, failure paths, and weird paths.
385287
- Tests live in the `tests/Feature` and `tests/Unit` directories.
@@ -456,6 +358,13 @@ it('has emails', function (string $email) {
456358
457359
- Always use Tailwind CSS v4 - do not use the deprecated utilities.
458360
- `corePlugins` is not supported in Tailwind v4.
361+
- In Tailwind v4, configuration is CSS-first using the `@theme` directive — no separate `tailwind.config.js` file is needed.
362+
<code-snippet name="Extending Theme in CSS" lang="css">
363+
@theme {
364+
--color-brand: oklch(0.72 0.11 178);
365+
}
366+
</code-snippet>
367+
459368
- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3:
460369
461370
<code-snippet name="Tailwind v4 Import Tailwind Diff" lang="diff">
@@ -483,12 +392,4 @@ it('has emails', function (string $email) {
483392
| overflow-ellipsis | text-ellipsis |
484393
| decoration-slice | box-decoration-slice |
485394
| decoration-clone | box-decoration-clone |
486-
487-
488-
=== tests rules ===
489-
490-
## Test Enforcement
491-
492-
- 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.
493-
- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test` with a specific filename or filter.
494395
</laravel-boost-guidelines>

app/Console/Commands/Install.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
use App\Models\User;
66
use App\Enums\UserRole;
77
use Illuminate\Console\Command;
8+
use function Laravel\Prompts\info;
9+
use function Laravel\Prompts\text;
810
use Illuminate\Support\Facades\Hash;
9-
use App\Console\Commands\Concerns\CanShowAnIntro;
1011
use function Laravel\Prompts\confirm;
1112
use function Laravel\Prompts\password;
12-
use function Laravel\Prompts\text;
13-
use function Laravel\Prompts\info;
13+
use App\Console\Commands\Concerns\CanShowAnIntro;
1414

1515
class Install extends Command
1616
{
@@ -65,9 +65,9 @@ protected function createUser(): User
6565
protected function linkStorage(): void
6666
{
6767
if (!file_exists(public_path('storage')) && confirm(
68-
label: 'Your storage does not seem to be linked, do you want me to do this?',
69-
hint: '(php artisan storage:link)'
70-
)
68+
label: 'Your storage does not seem to be linked, do you want me to do this?',
69+
hint: '(php artisan storage:link)'
70+
)
7171
) {
7272
$this->call('storage:link');
7373
}
@@ -95,9 +95,9 @@ protected function publishAssets(): void
9595
protected function askForStar(): void
9696
{
9797
if (User::count() === 1 && confirm(
98-
label: 'Would you like to show some love by starring the repo?',
99-
default: true
100-
)
98+
label: 'Would you like to show some love by starring the repo?',
99+
default: true
100+
)
101101
) {
102102
if (PHP_OS_FAMILY === 'Darwin') {
103103
exec('open https://github.com/ploi/roadmap');

app/Console/Commands/Upgrade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use App\Services\SystemChecker;
66
use Illuminate\Console\Command;
7-
use App\Console\Commands\Concerns\CanShowAnIntro;
87
use function Laravel\Prompts\info;
8+
use App\Console\Commands\Concerns\CanShowAnIntro;
99

1010
class Upgrade extends Command
1111
{

app/Filament/Pages/Colors.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace App\Filament\Pages;
44

5-
use Filament\Schemas\Schema;
6-
use Filament\Schemas\Components\Section;
75
use App\Enums\UserRole;
8-
use Filament\Forms\Components\Toggle;
6+
use Filament\Schemas\Schema;
97
use App\Settings\ColorSettings;
108
use Filament\Pages\SettingsPage;
119
use Illuminate\Support\HtmlString;
10+
use Filament\Forms\Components\Toggle;
1211
use Filament\Forms\Components\TextInput;
12+
use Filament\Schemas\Components\Section;
1313
use Filament\Forms\Components\FileUpload;
1414
use Filament\Forms\Components\ColorPicker;
1515
use Illuminate\Contracts\Support\Htmlable;

app/Filament/Pages/Settings.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22

33
namespace App\Filament\Pages;
44

5-
use Filament\Schemas\Schema;
6-
use Filament\Schemas\Components\Tabs;
7-
use Filament\Schemas\Components\Tabs\Tab;
8-
use Filament\Schemas\Components\Section;
9-
use Filament\Schemas\Components\Utilities\Get;
10-
use Filament\Schemas\Components\Grid;
11-
use Filament\Schemas\Components\Group;
125
use App\Models\Board;
136
use App\Enums\UserRole;
147
use App\Models\Project;
158
use Illuminate\Support\Str;
169
use App\Enums\InboxWorkflow;
1710
use Filament\Actions\Action;
11+
use Filament\Schemas\Schema;
1812
use App\Services\GitHubService;
1913
use Filament\Pages\SettingsPage;
2014
use App\Settings\GeneralSettings;
2115
use Illuminate\Support\Collection;
2216
use Filament\Forms\Components\Select;
2317
use Filament\Forms\Components\Toggle;
18+
use Filament\Schemas\Components\Grid;
19+
use Filament\Schemas\Components\Tabs;
2420
use Filament\Support\Enums\Alignment;
21+
use Filament\Schemas\Components\Group;
2522
use Filament\Forms\Components\Repeater;
2623
use Filament\Forms\Components\Textarea;
2724
use Illuminate\Support\Facades\Storage;
2825
use Filament\Forms\Components\TagsInput;
2926
use Filament\Forms\Components\TextInput;
3027
use Filament\Notifications\Notification;
28+
use Filament\Schemas\Components\Section;
3129
use Filament\Forms\Components\RichEditor;
30+
use Filament\Schemas\Components\Tabs\Tab;
3231
use Illuminate\Contracts\Support\Htmlable;
32+
use Filament\Schemas\Components\Utilities\Get;
3333

3434
class Settings extends SettingsPage
3535
{
@@ -158,7 +158,7 @@ public function form(Schema $schema): Schema
158158
Grid::make()
159159
->columnSpanFull()
160160
->schema(
161-
[
161+
[
162162
Select::make('inbox_workflow')
163163
->label(trans('settings.general.inbox-workflow'))
164164
->helperText(trans('settings.general.inbox-workflow-helper-text'))
@@ -169,7 +169,7 @@ public function form(Schema $schema): Schema
169169
->label(trans('settings.general.roadmap-password'))
170170
->helperText(trans('settings.general.roadmap-password-helper-text')),
171171
]
172-
),
172+
),
173173

174174
RichEditor::make('welcome_text')
175175
->label(trans('settings.general.welcome-text'))

app/Filament/Pages/Widget.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
namespace App\Filament\Pages;
44

5+
use App\Enums\UserRole;
56
use Filament\Schemas\Schema;
6-
use Filament\Schemas\Components\Section;
7+
use App\Settings\WidgetSettings;
8+
use Filament\Pages\SettingsPage;
9+
use Illuminate\Support\HtmlString;
10+
use Filament\Forms\Components\Select;
11+
use Filament\Forms\Components\Toggle;
712
use Filament\Schemas\Components\Tabs;
13+
use App\Settings\ActivityWidgetSettings;
14+
use Filament\Forms\Components\TagsInput;
15+
use Filament\Forms\Components\TextInput;
16+
use Filament\Schemas\Components\Section;
817
use Filament\Schemas\Components\Tabs\Tab;
9-
use App\Enums\UserRole;
10-
use Filament\Forms\Components\Toggle;
11-
use Filament\Forms\Components\Select;
1218
use Filament\Forms\Components\ColorPicker;
13-
use Filament\Forms\Components\TextInput;
14-
use Filament\Forms\Components\TagsInput;
1519
use Filament\Forms\Components\Placeholder;
16-
use App\Settings\WidgetSettings;
17-
use App\Settings\ActivityWidgetSettings;
18-
use Filament\Pages\SettingsPage;
1920
use Illuminate\Contracts\Support\Htmlable;
20-
use Illuminate\Support\HtmlString;
2121

2222
class Widget extends SettingsPage
2323
{

app/Filament/Resources/Boards/BoardResource.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
namespace App\Filament\Resources\Boards;
44

5-
use Filament\Schemas\Schema;
6-
use Filament\Schemas\Components\Section;
7-
use App\Filament\Resources\Boards\Pages\ListBoards;
8-
use App\Filament\Resources\Boards\Pages\CreateBoard;
9-
use App\Filament\Resources\Boards\Pages\EditBoard;
105
use App\Models\Board;
116
use Filament\Tables\Table;
7+
use Filament\Schemas\Schema;
128
use Filament\Resources\Resource;
139
use Filament\Forms\Components\Select;
1410
use Filament\Forms\Components\Textarea;
1511
use Filament\Tables\Columns\TextColumn;
1612
use Filament\Forms\Components\TextInput;
17-
use App\Filament\Resources\BoardResource\Pages;
13+
use Filament\Schemas\Components\Section;
14+
use App\Filament\Resources\Boards\Pages\EditBoard;
15+
use App\Filament\Resources\Boards\Pages\ListBoards;
16+
use App\Filament\Resources\Boards\Pages\CreateBoard;
1817

1918
class BoardResource extends Resource
2019
{

app/Filament/Resources/Boards/Pages/CreateBoard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace App\Filament\Resources\Boards\Pages;
44

5-
use App\Filament\Resources\Boards\BoardResource;
65
use Filament\Resources\Pages\CreateRecord;
6+
use App\Filament\Resources\Boards\BoardResource;
77

88
class CreateBoard extends CreateRecord
99
{

app/Filament/Resources/Boards/Pages/ListBoards.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace App\Filament\Resources\Boards\Pages;
44

5-
use App\Filament\Resources\Boards\BoardResource;
65
use Filament\Resources\Pages\ListRecords;
6+
use App\Filament\Resources\Boards\BoardResource;
77

88
class ListBoards extends ListRecords
99
{

0 commit comments

Comments
 (0)