Skip to content

Commit 699cca9

Browse files
committed
formatting
1 parent bfab22e commit 699cca9

File tree

11 files changed

+84
-71
lines changed

11 files changed

+84
-71
lines changed

.ai/core.blade.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
# Laravel Boost Guidelines
2-
The Laravel Boost Guidelines are specifically curated by Laravel maintainers for this project. These guidelines should be followed closely to help enhance the user's experience and satisfaction.
2+
3+
The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to help enhance the user's experience and satisfaction building Laravel applications.
34

45
## Foundational Context
5-
This project is a Laravel app and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure we abide by these specific packages & versions.
6+
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.
67

78
- php - {{ PHP_VERSION }}
89
@foreach (app(\Laravel\Roster\Roster::class)->packages()->unique(fn ($package) => $package->rawName()) as $package)
910
- {{ $package->rawName() }} ({{ $package->name() }}) - v{{ $package->majorVersion() }}
1011
@endforeach
1112

12-
@if(!empty(config('boost.project_purpose')))
13-
Project purpose: {!! config('boost.project_purpose') !!}
13+
@if (! empty(config('boost.purpose')))
14+
Application purpose: {!! config('boost.purpose') !!}
1415
@endif
1516

1617
## Conventions
17-
- 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.
18-
- Use descriptive names. For example, `isRegisteredForDiscounts` not `discount()`.
19-
- Check for existing components to reuse before writing one anew.
18+
- 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.
19+
- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`.
20+
- Check for existing components to reuse before writing a new one.
2021

2122
## Verification Scripts
2223
- Do not create verification scripts or tinker when tests cover that functionality and prove it works. Unit and feature tests are more important.
2324

24-
## Project Structure and Architecture
25-
- Stick to existing directory structure - no new base folders without approval.
26-
- No dependency changes without approval.
25+
## Application Structure & Architecture
26+
- Stick to existing directory structure - don't create new base folders without approval.
27+
- Do not change the application's dependencies without approval.
2728

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

.ai/enforce-tests.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
- 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.
1+
## Test Enforcement
2+
3+
- 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.
24
- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test` with a specific filename or filter.

.ai/php/8.4/core.blade.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
## PHP 8.4 has new array functions that will make code simpler whenever we don't use Collections
1+
## PHP 8.4
22

3-
- `array_find(array $array, callable $callback): mixed` - Find first matching element
4-
- `array_find_key(array $array, callable $callback): int|string|null` - Find first matching key
5-
- `array_any(array $array, callable $callback): bool` - Check if any element satisfies a callback function
6-
- `array_all(array $array, callable $callback): bool` - Check if all elements satisfy a callback function
3+
- PHP 8.4 has new array functions that will make code simpler whenever we don't use Laravel's collections.
4+
- `array_find(array $array, callable $callback): mixed` - Find first matching element
5+
- `array_find_key(array $array, callable $callback): int|string|null` - Find first matching key
6+
- `array_any(array $array, callable $callback): bool` - Check if any element satisfies a callback function
7+
- `array_all(array $array, callable $callback): bool` - Check if all elements satisfy a callback function
78

8-
## Make use of cleaner chaining on new instances
9-
<code-snippet name="No extra parentheses needed for chaining on new instances" lang="php">
10-
// Before
9+
### Cleaner Chaining on New Instances
10+
- No extra parentheses are needed when chaining on new object instances:
11+
<code-snippet name="New Object Chaining Example" lang="php">
12+
// Before PHP 8.4
1113
$response = (new JsonResponse(['data' => $data]))->setStatusCode(201);
1214

13-
// After
15+
// After PHP 8.4
1416
$response = new JsonResponse(['data' => $data])->setStatusCode(201);
1517
</code-snippet>

.ai/php/core.blade.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1+
## PHP
2+
13
@php
24
/** @var \Laravel\Boost\Install\GuidelineAssist $assist */
35
@endphp
4-
56
@if($assist->shouldEnforceStrictTypes())
6-
- Always use strict typing at the head of a .php file: `declare(strict_types=1);`.
7+
- Always use strict typing at the head of a `.php` file: `declare(strict_types=1);`.
78
@endif
89
- Always use curly braces for control structures, even if it has one line.
910

10-
## Constructors
11+
### Constructors
1112
- Use PHP 8 constructor property promotion in `__construct()`.
12-
<code-snippet>public function __construct(public GitHub $github) { }</code-snippet>
13+
- <code-snippet>public function __construct(public GitHub $github) { }</code-snippet>
1314
- Do not allow empty `__construct()` methods with zero parameters.
1415

15-
## Type Declarations
16+
### Type Declarations
1617
- Always use explicit return type declarations for methods and functions.
1718
- Use appropriate PHP type hints for method parameters.
18-
<code-snippet name="Explicit return types and method params" lang="php">
19+
20+
<code-snippet name="Explicit Return Types and Method Params" lang="php">
1921
protected function isAccessible(User $user, ?string $path = null): bool
2022
{
2123
...
2224
}
2325
</code-snippet>
2426

2527
## Comments
26-
- Prefer PHPDoc blocks over comments. Use zero comments, unless there is something _very_ complex going on.
28+
- Prefer PHPDoc blocks over comments. Never use comments within the code itself unless there is something _very_ complex going on.
2729

28-
## PHPDoc blocks
29-
- Add useful array shape definitions for arrays
30+
## PHPDoc Blocks
31+
- Add useful array shape type definitions for arrays when appropriate.
3032

3133
## Enums
3234
@if(empty($assist->enums()) || preg_match('/[A-Z]{3,8}/', $assist->enumContents()))
33-
- Keys in an Enum should be UPPERCASE and words separated with an underscore. i.e. `FAVORITE_PERSON`, `BEST_LAKE`, `MONTHLY`
35+
- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`.
3436
@else
35-
- Keys in an Enum should follow existing Enum conventions.
37+
- That being said, keys in an Enum should follow existing application Enum conventions.
3638
@endif

.ai/phpunit/core.blade.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
## PHPUnit Core
22

3-
- We are using PHPUnit for testing. All tests must be written as PHPUnit classes.
3+
- This application uses PHPUnit for testing. All tests must be written as PHPUnit classes.
44
- If you see a test using "Pest", convert it to PHPUnit.
55
- Every time a test has been updated, run that singular test.
6-
- When the tests relating to your feature are passing, ask the user if they'd like to also run the entire test suite to make sure everything is still passing.
7-
- Tests should test all of the unhappy paths, happy paths, and weird paths.
6+
- When the tests relating to your feature are passing, ask the user if they would like to also run the entire test suite to make sure everything is still passing.
7+
- Tests should test all of the happy paths, failure paths, and weird paths.
88
- 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.
99

10-
11-
# Running tests
10+
### Running Tests
1211
- Run the minimal number of tests, using an appropriate filter, before finalizing.
13-
- Run all tests: `php artisan test`.
14-
- Run all tests in a file: `php artisan test tests/Feature/ExampleTest.php`.
15-
- Filter on particular test name: `php artisan test --filter=testName` (recommended after making a change to a related file).
12+
- To run all tests: `php artisan test`.
13+
- To run all tests in a file: `php artisan test tests/Feature/ExampleTest.php`.
14+
- To filter on a particular test name: `php artisan test --filter=testName` (recommended after making a change to a related file).

.ai/pint/core.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
## Pint Code Formatting Core
1+
## Laravel Pint Code Formatter
2+
23
- You must run `vendor/bin/pint` before finalizing changes to ensure your code matches the project's expected style.
34
- Do not run `vendor/bin/pint --test`, simply run `vendor/bin/pint` to fix any formatting issues.

.ai/tailwindcss/3/core.blade.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
- Always use Tailwind CSS v3, verify you're using only supported classes.
2-
- Use the `search-docs` tool to find exactly what's supported in this project's Tailwind setup.
1+
## Tailwind 3
2+
3+
- Always use Tailwind CSS v3 - verify you're using only classes supported by this version.
4+
- Use the `search-docs` tool to find exactly what's supported in this application's Tailwind setup.

.ai/tailwindcss/4/core.blade.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
- Always use Tailwind CSS v4, do not use the deprecated utilities.
2-
- Use the `search-docs` tool to find exactly what's supported in this project's Tailwind setup.
3-
- In Tailwind v4 you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3:
1+
## Tailwind 4
2+
3+
- Always use Tailwind CSS v4 - do not use the deprecated utilities.
4+
- Use the `search-docs` tool to find exactly what's supported in this application's Tailwind setup.
5+
- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3:
46
@verbatim
57
<code-snippet name="Tailwind v4 import tailwind diff" lang="diff"
68
- @tailwind base;
@@ -9,10 +11,10 @@
911
+ @import "tailwindcss";
1012
</code-snippet>
1113
@endverbatim
12-
- `corePlugins` is not supported in v4.
14+
- `corePlugins` is not supported in Tailwind v4.
1315

14-
## Replaced utilities
15-
- Tailwind v4 removed deprecated utilities. Do not use the deprecated option, use the replacement.
16+
### Replaced Utilities
17+
- Tailwind v4 removed deprecated utilities. Do not use the deprecated option - use the replacement.
1618
- Opacity values are still numeric.
1719

1820
| Deprecated | Replacement |
@@ -28,4 +30,3 @@
2830
| overflow-ellipsis | text-ellipsis |
2931
| decoration-slice | box-decoration-slice |
3032
| decoration-clone | box-decoration-clone |
31-

.ai/tailwindcss/core.blade.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
- Use Tailwind CSS classes to style HTML, check and use existing tailwind conventions within the project before writing your own.
2-
- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc..)
3-
- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, group elements logically
1+
## Tailwind Core
42

5-
## Spacing
6-
- Use gap utilities for spacing, don't use margins
3+
- Use Tailwind CSS classes to style HTML. Check and use existing Tailwind conventions within the project before writing your own.
4+
- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc.).
5+
- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, and group elements logically.
6+
7+
### Spacing
8+
- When listing items, use gap utilities for spacing, don't use margins.
79
@verbatim
8-
<code-snippet name="Valid Flex gap spacing example" lang="html">
10+
<code-snippet name="Valid Flex Gap Spacing Example" lang="html">
911
<div class="flex gap-8">
1012
<div>Superior</div>
1113
<div>Michigan</div>
@@ -14,5 +16,5 @@
1416
</code-snippet>
1517
@endverbatim
1618

17-
## Tailwind Dark Mode
19+
### Dark Mode
1820
- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`.

.ai/volt/core.blade.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
- This project uses Livewire Volt for interactivity within its pages. New pages requiring interactivity must also use Livewire Volt. There is documentation available for it.
2-
- Volt is an elegantly crafted **functional** API for Livewire that supports single-file components, allowing a component's PHP logic and Blade templates to coexist in the same file
3-
- **Single-File Components**: Livewire Volt allows PHP logic and Blade templates in one file. Components use the `@volt` directive.
4-
- You must check existing Volt components to find out if they're functional or class based. If you can't detect that, ask the user which they prefer before writing a Volt component.
1+
## Livewire Volt
52

3+
- This project uses Livewire Volt for interactivity within its pages. New pages requiring interactivity must also use Livewire Volt. There is documentation available for it.
4+
- Volt is an elegantly crafted **class-based** and **functional** API for Livewire that supports single-file components, allowing a component's PHP logic and Blade templates to co-exist in the same file
5+
- Livewire Volt allows PHP logic and Blade templates in one file. Components use the `@volt` directive.
6+
- You must check existing Volt components to determine if they're functional or class based. If you can't detect that, ask the user which they prefer before writing a Volt component.
67

7-
## Volt Functional Component Example
8+
### Volt Functional Component Example
89
@verbatim
910
<code-snippet name="Volt Functional Component Example" lang="php">
1011
@volt
@@ -29,7 +30,7 @@
2930
</code-snippet>
3031
@endverbatim
3132

32-
## Volt Class based Component Example
33+
### Volt Class Based Component Example
3334
To get started, define an anonymous class that extends Livewire\Volt\Component. Within the class, you may utilize all of the features of Livewire using traditional Livewire syntax:
3435

3536
@verbatim
@@ -53,7 +54,7 @@ public function increment()
5354
@endverbatim
5455

5556
### Testing Volt & Volt Components
56-
- Use the existing location if tests already exist, otherwise fallback to `tests/Feature/Volt`
57+
- Use the existing directory for tests if it already exists. Otherwise, fallback to `tests/Feature/Volt`.
5758

5859
<code-snippet name="Livewire Test Example" lang="php">
5960
use Livewire\Volt\Volt;
@@ -67,7 +68,7 @@ public function increment()
6768
</code-snippet>
6869

6970
@verbatim
70-
<code-snippet name="Volt component test using Pest" lang="php">
71+
<code-snippet name="Volt Component Test Using Pest" lang="php">
7172
declare(strict_types=1);
7273

7374
use App\Models\{User, Product};
@@ -89,10 +90,10 @@ public function increment()
8990
</code-snippet>
9091
@endverbatim
9192

92-
## Common Patterns
93+
### Common Patterns
9394

9495
@verbatim
95-
<code-snippet name="CRUD with Volt" lang="php">
96+
<code-snippet name="CRUD With Volt" lang="php">
9697
@volt
9798
use App\Models\Product;
9899
use function Livewire\Volt\{state, computed};
@@ -106,24 +107,23 @@ public function increment()
106107
$edit = fn(Product $product) => $this->editing = $product->id;
107108
$delete = fn(Product $product) => $product->delete();
108109
?>
109-
110-
<!-- UI here -->
111110
@endvolt
111+
112+
<!-- UI here -->
112113
</code-snippet>
113114
@endverbatim
114115

115116
@verbatim
116-
<code-snippet name="Real-time search with Volt" lang="php">
117+
<code-snippet name="Real-time Search With Volt" lang="php">
117118
<flux:input
118119
wire:model.live.debounce.300ms="search"
119120
placeholder="Search..."
120121
/>
121122
</code-snippet>
122123
@endverbatim
123124

124-
125125
@verbatim
126-
<code-snippet name="Loading states with Volt" lang="php">
126+
<code-snippet name="Loading States With Volt" lang="php">
127127
<flux:button wire:click="save" wire:loading.attr="disabled">
128128
<span wire:loading.remove>Save</span>
129129
<span wire:loading>Saving...</span>

0 commit comments

Comments
 (0)