This is a template package for Eclipse Filament plugins/packages. It serves as a base to develop new plugins with our
tech stack, tools and documented implementation decisions and conventions.
All plugins developed by DataLinx should use this package as a base by creating the new package and use this package as
a template.
Even though it is a template, it is a fully functional plugin and serves as a working example of a DataLinx Eclipse
Filament plugin.
To test the plugin, the contained workbench app is used. This is made possible by Lando, which is already configured and
ready to use by simply running lando start in the package root.
Also, read and take into account the README.md file for project-specific documentation.
=== .ai/20-common-ai-guidelines rules ===
This section contains common instructions for AI systems working on Eclipse PHP packages. It is intended to be included
by Laravel Boost to create AI agent-focused documentation (e.g the AGENTS.md file).
This lowers the maintenance burden and keeps the instructions consistent across packages.
All paths and commands in this file are relative to the root of the package.
Any preceding or following documentation referring to running commands and tests, coding guidelines, environment setup,
and other technical details should be adapted by taking these common guidelines into account.
- Source code lives in
src/ - Tests live in
tests/ - Workbench (testing) application lives in
workbench/ - Package testbench configuration is in
testbench.yaml
- PHP 8.3+
- Filament
- Orchestra Testbench
- Pest / PHPUnit
- Composer
- Laravel Pint
- Lando / Docker for development
Because the application in development runs in a Docker container, using Lando as a wrapper, use the Lando commands to run commands inside the container.
lando php <command>lando composer <command>To run a command against the workbench application, use the testbench command instead of artisan:
lando testbench <command>E.g.
lando testbench migrate- Follow Laravel conventions.
- Follow PSR-12 style.
- Use Laravel Pint for formatting.
- Prefer typed properties, return types, and constructor property promotion where appropriate.
- Keep classes small and focused.
- Use clear, descriptive names.
- Avoid unnecessary abstractions.
- Do not introduce dependencies unless they are clearly justified.
lando formatTo pass parameters to the internal tool, use double dash before the parameters:
lando format -- <parameters>E.g.
lando format -- --dirtyBefore considering a task complete, run:
lando format
lando test- Use PHP 8.3-compatible syntax only.
- Prefer strict, readable code over clever code.
- Use enums where they improve clarity.
- Use Laravel collections only when they make the code easier to read.
- Prefer dependency injection over facades when practical.
- Avoid global helpers unless they already exist in the project and are appropriate.
- Keep package code inside
src/. - Use the namespace defined in
composer.jsonfor package classes. - Register package services through the package service provider.
- Keep workbench-only code inside
workbench/. - Do not place application-specific logic in package source code.
- Avoid publishing config, migrations, or assets unless required by the package behavior.
- Use Pest for new tests unless an existing nearby test uses PHPUnit style.
- Place feature tests in
tests/Feature. - Place unit tests in
tests/Unit. - Place testing support classes in
tests/Support. - Use Orchestra Testbench patterns for package tests.
- Prefer testing public behavior rather than private implementation details.
- Add or update tests when changing behavior.
To run all tests:
lando testTo run specific tests or to pass parameters to Pest:
lando test -- <parameters>E.g.:
lando test -- --filter=ArchTestIf running the full test suite is too expensive, run the most relevant test file and explain what was run.
- Update
README.mdwhen changing public package behavior. - Update examples when APIs change.
- Keep documentation concise and practical.
- Do not update the
CHANGELOG.mdfile — it is automatically updated by a GitHub Action.
When working in this repository:
- Inspect existing nearby code before proposing changes.
- Preserve existing project structure and naming conventions.
- Prefer small, incremental changes.
- Do not rewrite files unnecessarily.
- Do not add new packages without asking.
- Do not change public APIs without explaining the impact.
- Include tests for behavior changes.
- Mention any commands that should be run to verify the change.
=== boost rules ===
- Laravel Boost is an MCP server with tools designed specifically for this application. Prefer Boost tools over manual alternatives like shell commands or file reads.
- Use
database-queryto run read-only queries against the database instead of writing raw SQL in tinker. - Use
database-schemato inspect table structure before writing migrations or models. - Use
get-absolute-urlto resolve the correct scheme, domain, and port for project URLs. Always use this before sharing a URL with the user. - Use
browser-logsto read browser logs, errors, and exceptions. Only recent logs are useful, ignore old entries.
- Use
search-docsbefore changes that depend on Laravel ecosystem APIs, behavior, configuration, or version-specific syntax. Skip it for copy-only edits and other changes where package documentation is irrelevant. Reuse sufficient results already in context instead of searching again. - Pass a
packagesarray to scope results when you know which packages are relevant. - Use multiple broad, topic-based queries:
['rate limiting', 'routing rate limiting', 'routing']. Expect the most relevant results first. - Do not add package names to queries because package info is already shared. Use
test resource table, notfilament 4 test resource table.
- Use words for auto-stemmed AND logic:
rate limitmatches both "rate" AND "limit". - Use
"quoted phrases"for exact position matching:"infinite scroll"requires adjacent words in order. - Combine words and phrases for mixed queries:
middleware "rate limit". - Use multiple queries for OR logic:
queries=["authentication", "middleware"].
- This project contains committed, area-grouped rules in
.ai/ruleswhen that directory exists (settled decisions, non-obvious traps, standing constraints). Framework and package guidelines that only apply to specific paths (testing, frontend, components) also live there, under.ai/rules/boost— this is not just recorded decisions, it is load-bearing guidance you have not seen inline. Before you enter plan mode or create/edit any file, you MUST first: open @.ai/rules/index.md (it maps file globs to rule files), read every rule file whose globs cover the path(s) in scope, and rungrep -rin 'keyword' .ai/rulesto catch what a path match alone misses. Do not write code until you have read and are following every matching rule. If.ai/rulesdoes not exist, continue without it. - Record a rule with
record-ruleonly when the user explicitly asks for one. Instructions for the work at hand are not rules, no matter how emphatic: "remove this typo", "use X here" are work to do, not rules to record. Never record a rule on your own initiative, as a byproduct of a change, or to summarize what you just did. When the user does ask, pass aglob(e.g.app/Http/Controllers/**), a shorttitle, and a few-linenote. Userecord-rulerather than your native memory or notes tool, because native memory is personal and session-scoped, while only.ai/rulesis shared with the team and persists in the repo.
- Run Artisan commands directly via the command line (e.g.,
php artisan route:list). Usephp artisan listto discover available commands andphp artisan [command] --helpto check parameters. - Inspect routes with
php artisan route:list. Filter with:--method=GET,--name=users,--path=api,--except-vendor,--only-vendor. - Read configuration values using dot notation:
php artisan config:show app.name,php artisan config:show database.default. Or read config files directly from theconfig/directory.
- Execute PHP in app context for debugging and testing code. Do not create models without user approval, prefer tests with factories instead. Prefer existing Artisan commands over custom tinker code.
- Always use single quotes to prevent shell expansion:
php artisan tinker --execute 'Your::code();'- Double quotes for PHP strings inside:
php artisan tinker --execute 'User::where("active", true)->count();'
- Double quotes for PHP strings inside:
=== php rules ===
- Always use curly braces for control structures, even for single-line bodies.
- Use PHP 8 constructor property promotion:
public function __construct(public GitHub $github) { }. Do not leave empty zero-parameter__construct()methods unless the constructor is private. - Use explicit return type declarations and type hints for all method parameters:
function isAccessible(User $user, ?string $path = null): bool - Use TitleCase for Enum keys:
FavoritePerson,BestLake,Monthly. - Prefer PHPDoc blocks over inline comments. Only add inline comments for exceptionally complex logic.
- Use array shape type definitions in PHPDoc blocks.
=== deployments rules ===
- Laravel can be deployed using Laravel Cloud, which is the fastest way to deploy and scale production Laravel applications.
- Activate the
deploying-to-cloudskill whenever deploying to Laravel Cloud, configuring Cloud environments or resources, using the Cloud CLI, or troubleshooting Cloud deployments.
=== laravel/core rules ===
- Use
php artisan make:commands to create new files (i.e. migrations, controllers, models, etc.). You can list available Artisan commands usingphp artisan listand check their parameters withphp artisan [command] --help. - If you're creating a generic PHP class, use
php artisan make:class. - Pass
--no-interactionto all Artisan commands to ensure they work without user input. You should also pass the correct--optionsto ensure correct behavior.
- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using
php artisan make:model --helpto check the available options.
- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention.
- When generating links to other pages, prefer named routes and the
route()function.
- 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()orfake()->randomDigit(). Follow existing conventions whether to use$this->fakerorfake(). - When creating tests, make use of
php artisan make:test [options] {name}to create a feature test, and pass--unitto create a unit test. Most tests should be feature tests.
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run
npm run buildor ask the user to runnpm run devorcomposer run dev.
=== laravel/v12 rules ===
- CRITICAL: ALWAYS use
search-docstool for version-specific Laravel documentation and updated code examples. - Since Laravel 11, Laravel has a new streamlined file structure which this project uses.
- In Laravel 12, middleware are no longer registered in
src/Http/Kernel.php. - Middleware are configured declaratively in
bootstrap/app.phpusingApplication::configure()->withMiddleware(). bootstrap/app.phpis the file to register middleware, exceptions, and routing files.bootstrap/providers.phpcontains application specific service providers.- The
src/Console/Kernel.phpfile no longer exists; usebootstrap/app.phporroutes/console.phpfor console configuration. - Console commands in
src/Console/Commands/are automatically available and do not require manual registration.
-
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);.
- Casts can and likely should be set in a
casts()method on a model rather than the$castsproperty. Follow existing conventions from other models.
=== pint/core rules ===
- If you have modified any PHP files, you must run
vendor/bin/pint --dirty --format agentbefore finalizing changes to ensure your code matches the project's expected style. - Do not run
vendor/bin/pint --test --format agent, simply runvendor/bin/pint --format agentto fix any formatting issues.
=== pest/core rules ===
- This project uses Pest. Create tests with
php artisan make:test --pest {name}. - Do not include the test suite directory in
{name}. UseSomeFeatureTest, notFeature/SomeFeatureTest. - Read the
testing-best-practicesskill for guidance on coverage, naming, structure, dependency isolation, and review. - Do not delete tests or test files without approval. They are part of the application.
- Run the narrowest set of tests that covers the change. Pass a file path or
--filter=testNametophp artisan test --compact. - Rerun a test after each change to it.
- Run
vendor/bin/pestto call the test runner directly. It accepts the same file path and--filter=testNamearguments. - After the feature tests pass, ask the user to run the complete suite with
php artisan test --compact.