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
15 changes: 7 additions & 8 deletions .ai/boost/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
# URLs
- Whenever you create a URL use the `get-absolute-url` tool to ensure you're using the correct scheme, domain/IP, and port.
Whenever you create a URL use the `get-absolute-url` tool to ensure you're using the correct scheme, domain / IP, and port.

# Artisan
- Use the `list-artisan-commands` tool when needing to call an artisan command to triple check the available params
Use the `list-artisan-commands` tool when you need to call an artisan command to triple check the available parameters.

# Tinker / Debugging
You should use the `tinker` tool from Boost MCP when you need to run PHP to debug code or query eloquent models directly.
Use the `database-query` tool when you only need to read from the database.
You should use the `tinker` tool from Boost MCP when you need to run 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
Only recent browser logs will be useful, discard any that are older than two hours or so.

# Searching documentation

Check the docs before making code changes to ensure we are approaching this in the correct way. Use multiple simple topic based queries.

Boost comes with a powerful `search-docs` tool you should use before any other approaches. This tool automatically passes a list of installed packages and their versions to the remote Boost API, so it returns only version-specific documentation specific for the user's circumstance. You should pass an array of packages to filter docs on if you know you need docs for particular packages.

'search-docs' tool is perfect for all Laravel related packages. Laravel, inertia, pest, livewire, nova, nightwatch, and more.
The 'search-docs' tool is perfect for all Laravel related packages. Laravel, Inertia, Pest, Livewire, Nova, Nightwatch, and more.

You must use this tool to search for Laravel-ecosystem docs before falling back to other approaches.

## Available Search Syntax
## Available search syntax
You can and should pass multiple queries at once, the most relevant will be returned first. Start specific, broaden after.

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 "queue" AND "worker"
3. Quoted Phrases (Exact Position) - query="infinite scroll - Words must be adjacent in that order
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

10 changes: 5 additions & 5 deletions .ai/core.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@

## Conventions
- You must follow all existing code conventions used in this project. When creating or editing a file, check sibling files for the correct structure, approach, naming.
- Use descriptive names. e.g. `isRegisteredForDiscounts` not `discount()`
- Use descriptive names. For example, `isRegisteredForDiscounts` not `discount()`.

## Verification scripts
- Do not create verification scripts or tinker when tests cover that functionality and prove it works. Unit & feature tests are more important.
## 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.

## Project Structure & Architecture
## Project Structure and Architecture
- Stick to existing directory structure - no new base folders without approval.
- No dependency changes without approval.

## Replies
- Be concise in your explanations - focus on what's important rather than explaining obvious details.

## Documentation files
## Documentation Files
- You must only create documentation files if explicitly requested by the user.

2 changes: 1 addition & 1 deletion .ai/fluxui-free/core.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
<flux:button variant="primary"/>
</code-snippet>
- Fallback to standard Blade components if Flux is unavailable.
- Use Laravel Boost's `search-docs` tool to get the exact documentation & code snippets available for this project.
- Use Laravel Boost's `search-docs` tool to get the exact documentation and code snippets available for this project.
2 changes: 1 addition & 1 deletion .ai/fluxui-pro/core.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
<flux:button variant="primary"/>
</code-snippet>
- Fallback to standard Blade components if Flux is unavailable.
- Use Laravel Boost's `search-docs` tool to get the exact documentation & code snippets available for this project.
- Use Laravel Boost's `search-docs` tool to get the exact documentation and code snippets available for this project.
2 changes: 1 addition & 1 deletion .ai/inertia-laravel/1/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Inertia v1 core
## Inertia v1 Core

- Inertia v1 does _not_ come with these features. Do not recommend using these Inertia v2 features directly.
- Polling
Expand Down
7 changes: 5 additions & 2 deletions .ai/inertia-laravel/2/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
## Inertia v2 Core

- Make use of all Inertia features from v1 & v2

## Inertia v2 new features
## Inertia v2 New Features

- Polling
- Prefetching
- Deferred props
- Infinite scrolling using merging props and WhenVisible
- Lazy loading data on scroll

- When using deferred props on the frontend we should add a nice empty state with pulsing/animated skeleton/blocks. Check the docs before making any changes to ensure we are approaching this in the correct way.
- When using deferred props on the frontend we should add a nice empty state with pulsing / animated skeleton. Check the docs before making any changes to ensure we are approaching this in the correct way.
6 changes: 3 additions & 3 deletions .ai/inertia-laravel/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## InertiaJS Core
## Inertia Core

- Inertia.js components should be placed in the `resources/js/Pages` directory
- Use `Inertia::render()` for server-side routing instead of traditional Blade views
- Inertia.js components should be placed in the `resources/js/Pages` directory.
- Use `Inertia::render()` for server-side routing instead of traditional Blade views.
<code-snippet lang="php" name="Inertia::render example">
// routes/web.php example
Route::get('/users', function () {
Expand Down
4 changes: 2 additions & 2 deletions .ai/inertia-react/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
- Use `router.visit()` or `<Link>` for navigation instead of traditional links
- Use `router.visit()` or `<Link>` for navigation instead of traditional links.
<code-snippet lang="react" name="Inertia client navigation">
import { Link } from '@inertiajs/react'

<Link href="/">Home</Link>
</code-snippet>

- For form handling, use `router.post` and related methods, do not use regular forms
- For form handling, use `router.post` and related methods, do not use regular forms.
<code-snippet lang="react" name="Form example">
import { useState } from 'react'
import { router } from '@inertiajs/react'
Expand Down
6 changes: 3 additions & 3 deletions .ai/inertia-vue/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- Vue components must have a single root element
- Use `router.visit()` or `<Link>` for navigation instead of traditional links
- Vue components must have a single root element.
- Use `router.visit()` or `<Link>` for navigation instead of traditional links.
<code-snippet lang="vue" name="Inertia client navigation">
import { Link } from '@inertiajs/vue3'

<Link href="/">Home</Link>
</code-snippet>

- For form handling, use `router.post` and related methods, do not use regular forms
- For form handling, use `router.post` and related methods, do not use regular forms.
<code-snippet lang="vue" name="Form example">
<script setup>
import { reactive } from 'vue'
Expand Down
2 changes: 1 addition & 1 deletion .ai/laravel/10/core.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Laravel 10 Core
## Laravel 10 Core
6 changes: 3 additions & 3 deletions .ai/laravel/11/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Laravel 11 Core
## Laravel 11 Core

- **No app\Console\Kernel.php** - use `bootstrap/app.php` for console configurations
- **Commands auto-register** - files in `app/Console/Commands/` are automatically available
- **No app\Console\Kernel.php** - use `bootstrap/app.php` for console configurations.
- **Commands auto-register** - files in `app/Console/Commands/` are automatically available.
6 changes: 3 additions & 3 deletions .ai/laravel/12/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Laravel 12 Core
## Laravel 12 Core

- **No app\Console\Kernel.php** - use `bootstrap/app.php` for console configurations
- **Commands auto-register** - files in `app/Console/Commands/` are automatically available
- **No app\Console\Kernel.php** - use `bootstrap/app.php` for console configurations.
- **Commands auto-register** - files in `app/Console/Commands/` are automatically available.
21 changes: 12 additions & 9 deletions .ai/laravel/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Do things the Laravel way
- Use `./artisan make:` commands to create new files (i.e. migrations, controllers, models, etc..)
## Do Things the Laravel Way
- Use `./artisan make:` commands to create new files (i.e. migrations, controllers, models, etc.).
- If you're creating a generic PHP class, use `artisan make:class`.

## Database
Expand All @@ -10,20 +10,23 @@
- For DB pivot tables, use correct alphabetical order, like "project_role" instead of "role_project"
- Use Laravel's query builder for very complex database operations.

## Model Creation
- When creating new models, create factories and seeders for them too. Ask the user if they need any other things, use `list-artisan-commands` to check the available options to `./artisan make:model`

## APIs and Eloquent Resources
- For APIs, use Eloquent API Resources and API versioning

## Queues
- **Job and queue patterns**: Use queued jobs for time-consuming operations with the `ShouldQueue` interface.

## Authentication and Authorization
- Use Laravel built-in authentication and authorization features (Gates, Policies, Sanctum)
- For APIs, use Eloquent API Resources and API versioning

## Model creation
- When creating new models, create factories and seeders for them too. Ask the user if they need any other things, use `list-artisan-commands` to check the available options to `./artisan make:model`
## Config
- **Use environment variables** via config files, never `env()` directly. 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.

## Vite error
## 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`.

## Config
- **Use environment variables** via config files, never `env()` directly. Always use `config('app.name')` not `env('APP_NAME')`
4 changes: 2 additions & 2 deletions .ai/laravel/style.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Laravel Style Guidelines
- Every PHP file must start with `declare(strict_types=1);`
- Every PHP file must start with `declare(strict_types=1);`.
- Enforce strict typing: scalar types, return types, property types — everywhere.
- Strict array shapes only - no loose or untyped arrays.
- Use enums for fixed values.
- Use Enums for fixed values.
- Never use mixed types - including in array shapes.
- Prefer basic DTOs over raw complex arrays when appropriate.
2 changes: 1 addition & 1 deletion .ai/livewire/core.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Livewire Core
## Livewire Core
2 changes: 1 addition & 1 deletion .ai/pennant/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pennant Core
## Pennant Core

Feature flag instructions
This application uses Laravel Pennant for feature flag management, providing a flexible system for controlling feature availability across different organizations and user types.
22 changes: 11 additions & 11 deletions .ai/pest/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Testing
If you need to verify a feature is working, write or update a Unit/Feature test.
## Testing
If you need to verify a feature is working, write or update a Unit / Feature test.

# Pest tests
# Pest Tests
- All tests must be written using Pest.
- 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.
- Tests should test all of the the unhappy paths, happy paths, and weird paths.
- Tests live in the `tests/Feature` and `tests/Unit` directories
- Tests live in the `tests/Feature` and `tests/Unit` directories.
- Pest tests look and behave like this:
<code-snippet lang="php">
it('is true', function () {
expect(true)->toBeTrue();
});
</code-snippet>

# Running tests
# Running Tests
- Run the minimal number of tests, using an appropriate filter, before finalizing.
- Run all tests: `php artisan test`
- Run all tests in a file: `php artisan test tests/Feature/ExampleTest.php`
- Filter on particular test name: `php artisan test --filter=testName` (recommended after making a change to a related file)
- When the tests relating to your feature are passing, make sure to also run the entire test suite to ensure things are still ok.
- Run all tests: `php artisan test`.
- Run all tests in a file: `php artisan test tests/Feature/ExampleTest.php`.
- Filter on particular test name: `php artisan test --filter=testName` (recommended after making a change to a related file).
- When the tests relating to your feature are passing, make sure to also run the entire test suite to ensure everything is still passing.

## Pest Assertions
- When asserting status codes on a response, use the specific method like `assertForbidden`, `assertNotFound` etc, instead of using `assertStatus(403)` or similar, e.g.:
Expand All @@ -31,12 +31,12 @@
</code-snippet>

## Mocking
- Mocking is very helpful.
- Mocking can be very helpful.
- When mocking, you can use the pest function `Pest\Laravel\mock`, and always import it before usage with `use function Pest\Laravel\mock;` or you can use `$this->mock()`.
- You can also create partial mocks using the same import or self method.

## Datasets
- Use datasets in Pest to simplify tests which have a lot of duplicated data. This if for example often the case when testing validation rules, so often go with the solution of using datasets when writing tests for validation rules.
- Use datasets in Pest to simplify tests which have a lot of duplicated data. This if often the case when testing validation rules, so often go with the solution of using datasets when writing tests for validation rules.

<code-snippet lang="php" package="pest">
it('has emails', function (string $email) {
Expand Down
2 changes: 1 addition & 1 deletion .ai/php/core.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- Always use strict typing at the head of the file: `declare(strict_types=1);`
- Always use strict typing at the head of the file: `declare(strict_types=1);`.

## Constructors
- Use PHP 8 constructor property promotion in `__construct()`
Expand Down
10 changes: 5 additions & 5 deletions .ai/phpunit/core.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

- We are using PHPUnit for testing - if you see an example using Pest as part of a prompt, convert it to PHPUnit.
- Every time a test has been updated, run that singular test.
- When the tests relating to your feature are passing, make sure to also run the entire test suite to ensure things are still ok.
- When the tests relating to your feature are passing, make sure to also run the entire test suite to make sure everything is still passing.
- Tests should test all of the the unhappy paths, happy 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.
- Run all tests: `php artisan test`
- Run all tests in a file: `php artisan test tests/Feature/ExampleTest.php`
- Filter on particular test name: `php artisan test --filter=testName` (recommended after making a change to a related file)
- When the tests relating to your feature are passing, make sure to also run the entire test suite to ensure things are still ok.
- Run all tests: `php artisan test`.
- Run all tests in a file: `php artisan test tests/Feature/ExampleTest.php`.
- Filter on particular test name: `php artisan test --filter=testName` (recommended after making a change to a related file).
- When the tests relating to your feature are passing, make sure to also run the entire test suite to make sure everything is still passing.
Loading