Skip to content

Commit b8573a1

Browse files
committed
Refactor Sail Command Usage
Signed-off-by: Pushpak Chhajed <[email protected]>
1 parent 3065c86 commit b8573a1

File tree

18 files changed

+105
-62
lines changed

18 files changed

+105
-62
lines changed

.ai/enforce-tests.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
## Test Enforcement
55

66
- 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.
7-
- Run the minimum number of tests needed to ensure code quality and speed. Use `{{ $assist->artisan() }} test` with a specific filename or filter.
7+
- Run the minimum number of tests needed to ensure code quality and speed. Use `{{ $assist->artisanCommand('test') }}` with a specific filename or filter.

.ai/filament/3/core.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
- Tables use the `Tables\Columns` namespace for table columns.
1111
- A new `Filament\Forms\Components\RichEditor` component is available.
1212
- Form and table schemas now use fluent method chaining.
13-
- Added `{{ $assist->artisan() }} filament:optimize` command for production optimization.
13+
- Added `{{ $assist->artisanCommand('filament:optimize') }}` command for production optimization.
1414
- Requires implementing `FilamentUser` contract for production access control.

.ai/folio/core.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
- `pages/index.blade.php` → `/`
88
- `pages/profile/index.blade.php` → `/profile`
99
- `pages/auth/login.blade.php` → `/auth/login`
10-
- You may list available Folio routes using `{{ $assist->artisan() }} folio:list` or using Boost's `list-routes` tool.
10+
- You may list available Folio routes using `{{ $assist->artisanCommand("folio:list") }}` or using Boost's `list-routes` tool.
1111

1212
### New Pages & Routes
13-
- Always create new `folio` pages and routes using `{{ $assist->artisan() }} folio:page [name]` following existing naming conventions.
13+
- Always create new `folio` pages and routes using `{{ $assist->artisanCommand('folio:page [name]') }}` following existing naming conventions.
1414

1515
<code-snippet name="Example folio:page Commands for Automatic Routing" lang="shell">
1616
// Creates: resources/views/pages/products.blade.php → /products
17-
{{ $assist->artisan() }} folio:page 'products'
17+
{{ $assist->artisanCommand("folio:page 'products'") }}
1818

1919
// Creates: resources/views/pages/products/[id].blade.php → /products/{id}
20-
{{ $assist->artisan() }} folio:page 'products/[id]'
20+
{{ $assist->artisanCommand("folio:page 'products/[id]'") }}
2121
</code-snippet>
2222

2323
- Add a 'name' to each new Folio page at the very top of the file so it has a named route available for other parts of the codebase to use.

.ai/foundation.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
- Do not change the application's dependencies without approval.
3131

3232
## Frontend Bundling
33-
@if ($assist->config->enforceSail)
34-
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `{{ $assist->composer() }} run dev`. Ask them.
33+
@if ($assist->config->usesSail)
34+
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `{{ $assist->composerCommand('run dev') }}`. Ask them.
3535
@else
36-
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `{{ $assist->nodePackageManager() }} run build`, `{{ $assist->nodePackageManager() }} run dev`, or `{{ $assist->composer() }} run dev`. Ask them.
36+
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `{{ $assist->nodePackageManager() }} run build`, `{{ $assist->nodePackageManager() }} run dev`, or `{{ $assist->composerCommand('run dev') }}`. Ask them.
3737
@endif
3838

3939
## Replies

.ai/laravel/11/core.blade.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@php
2+
/** @var \Laravel\Boost\Install\GuidelineAssist $assist */
3+
@endphp
14
## Laravel 11
25

36
- Use the `search-docs` tool to get version specific documentation.
@@ -32,6 +35,6 @@
3235

3336
### New Artisan Commands
3437
- List Artisan commands using Boost's MCP tool, if available. New commands available in Laravel 11:
35-
- `{{ $assist->artisan() }} make:enum`
36-
- `{{ $assist->artisan() }} make:class`
37-
- `{{ $assist->artisan() }} make:interface`
38+
- `{{ $assist->artisanCommand('make:enum') }}`
39+
- `{{ $assist->artisanCommand('make:class') }} `
40+
- `{{ $assist->artisanCommand('make:interface') }} `

.ai/laravel/core.blade.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
@endphp
44
## Do Things the Laravel Way
55

6-
- Use `{{ $assist->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.
7-
- If you're creating a generic PHP class, use `{{ $assist->artisan() }} make:class`.
6+
- Use `{{ $assist->artisanCommand('make:') }}` commands to create new files (i.e. migrations, controllers, models, etc.). You can list available Artisan commands using the `list-artisan-commands` tool.
7+
- If you're creating a generic PHP class, use `{{ $assist->artisanCommand('make:class') }}`.
88
- 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.
99

1010
### Database
@@ -15,7 +15,7 @@
1515
- Use Laravel's query builder for very complex database operations.
1616

1717
### Model Creation
18-
- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using `list-artisan-commands` to check the available options to `{{ $assist->artisan() }} make:model`.
18+
- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using `list-artisan-commands` to check the available options to `{{ $assist->artisanCommand('make:model') }}`.
1919

2020
### APIs & Eloquent Resources
2121
- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention.
@@ -39,11 +39,11 @@
3939
### Testing
4040
- 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.
4141
- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`.
42-
- When creating tests, make use of `{{ $assist->artisan() }} make:test [options] <name>` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests.
42+
- When creating tests, make use of `{{ $assist->artisanCommand('make:test [options] <name>') }}` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests.
4343

4444
### Vite Error
45-
@if ($assist->config->enforceSail)
46-
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `{{ $assist->composer() }} run dev` or ask the user to run it.
45+
@if ($assist->config->usesSail)
46+
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `{{ $assist->composerCommand('run dev') }}` or ask the user to run it.
4747
@else
48-
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `{{ $assist->nodePackageManager() }} run build` or ask the user to run `{{ $assist->nodePackageManager() }} run dev` or `{{ $assist->composer() }} run dev`.
48+
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `{{ $assist->nodePackageManager() }} run build` or ask the user to run `{{ $assist->nodePackageManager() }} run dev` or `{{ $assist->composerCommand('run dev') }}`.
4949
@endif

.ai/livewire/core.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@endphp
44
## Livewire Core
55
- Use the `search-docs` tool to find exact version specific documentation for how to write Livewire & Livewire tests.
6-
- Use the `{{ $assist->artisan() }} make:livewire [Posts\\CreatePost]` artisan command to create new components
6+
- Use the `{{ $assist->artisanCommand('make:livewire [Posts\\CreatePost]') }}` artisan command to create new components
77
- State should live on the server, with the UI reflecting it.
88
- All Livewire requests hit the Laravel backend, they're like regular HTTP requests. Always validate form data, and run authorization checks in Livewire actions.
99

.ai/pest/core.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- If you need to verify a feature is working, write or update a Unit / Feature test.
77

88
### Pest Tests
9-
- All tests must be written using Pest. Use `{{ $assist->artisan() }} make:test --pest <name>`.
9+
- All tests must be written using Pest. Use `{{ $assist->artisanCommand('make:test --pest <name>') }}`.
1010
- 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.
1111
- Tests should test all of the happy paths, failure paths, and weird paths.
1212
- Tests live in the `tests/Feature` and `tests/Unit` directories.
@@ -19,9 +19,9 @@
1919

2020
### Running Tests
2121
- Run the minimal number of tests using an appropriate filter before finalizing code edits.
22-
- To run all tests: `{{ $assist->artisan() }} test`.
23-
- To run all tests in a file: `{{ $assist->artisan() }} test tests/Feature/ExampleTest.php`.
24-
- To filter on a particular test name: `{{ $assist->artisan() }} test --filter=testName` (recommended after making a change to a related file).
22+
- To run all tests: `{{ $assist->artisanCommand('test') }}`.
23+
- To run all tests in a file: `{{ $assist->artisanCommand('test tests/Feature/ExampleTest.php') }}`.
24+
- To filter on a particular test name: `{{ $assist->artisanCommand('test --filter=testName') }}` (recommended after making a change to a related file).
2525
- When the tests relating to your changes are passing, ask the user if they would like to run the entire test suite to ensure everything is still passing.
2626

2727
### Pest Assertions

.ai/phpunit/core.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@endphp
44
## PHPUnit Core
55

6-
- This application uses PHPUnit for testing. All tests must be written as PHPUnit classes. Use `{{ $assist->artisan() }} make:test --phpunit <name>` to create a new test.
6+
- This application uses PHPUnit for testing. All tests must be written as PHPUnit classes. Use `{{ $assist->artisanCommand('make:test --phpunit <name>') }}` to create a new test.
77
- If you see a test using "Pest", convert it to PHPUnit.
88
- Every time a test has been updated, run that singular test.
99
- 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.
@@ -12,6 +12,6 @@
1212

1313
### Running Tests
1414
- Run the minimal number of tests, using an appropriate filter, before finalizing.
15-
- To run all tests: `{{ $assist->artisan() }} test`.
16-
- To run all tests in a file: `{{ $assist->artisan() }} test tests/Feature/ExampleTest.php`.
17-
- To filter on a particular test name: `{{ $assist->artisan() }} test --filter=testName` (recommended after making a change to a related file).
15+
- To run all tests: `{{ $assist->artisanCommand('test') }}`.
16+
- To run all tests in a file: `{{ $assist->artisanCommand('test tests/Feature/ExampleTest.php') }}`.
17+
- To filter on a particular test name: `{{ $assist->artisanCommand('test --filter=testName') }}` (recommended after making a change to a related file).

.ai/pint/core.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
@endphp
44
## Laravel Pint Code Formatter
55

6-
- You must run `{{ $assist->bin() }}pint --dirty` before finalizing changes to ensure your code matches the project's expected style.
7-
- Do not run `{{ $assist->bin() }}pint --test`, simply run `{{ $assist->bin() }}pint` to fix any formatting issues.
6+
- You must run `{{ $assist->binCommand('pint') }} --dirty` before finalizing changes to ensure your code matches the project's expected style.
7+
- Do not run `{{ $assist->binCommand('pint') }} --test`, simply run `{{ $assist->binCommand('pint') }}` to fix any formatting issues.

0 commit comments

Comments
 (0)