diff --git a/.cursor/mcp.json b/.cursor/mcp.json new file mode 100644 index 00000000..ea301954 --- /dev/null +++ b/.cursor/mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "laravel-boost": { + "command": "php", + "args": [ + "./artisan", + "boost:mcp" + ] + } + } +} \ No newline at end of file diff --git a/.cursor/rules/laravel-boost.mdc b/.cursor/rules/laravel-boost.mdc new file mode 100644 index 00000000..aecaa3e0 --- /dev/null +++ b/.cursor/rules/laravel-boost.mdc @@ -0,0 +1,430 @@ +--- +alwaysApply: true +--- + +=== foundation rules === + +# Laravel Boost Guidelines + +The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to enhance the user's satisfaction building Laravel applications. + +## Foundational Context +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. + +- php - 8.4.11 +- filament/filament (FILAMENT) - v3 +- laravel/framework (LARAVEL) - v10 +- laravel/prompts (PROMPTS) - v0 +- livewire/livewire (LIVEWIRE) - v3 +- laravel/pint (PINT) - v1 +- alpinejs (ALPINEJS) - v3 +- tailwindcss (TAILWINDCSS) - v4 + + +## Conventions +- 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. +- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`. +- Check for existing components to reuse before writing a new one. + +## 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. + +## Application Structure & Architecture +- Stick to existing directory structure - don't create new base folders without approval. +- Do not change the application's dependencies without approval. + +## Frontend Bundling +- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them. + +## Replies +- Be concise in your explanations - focus on what's important rather than explaining obvious details. + +## Documentation Files +- You must only create documentation files if explicitly requested by the user. + + +=== boost rules === + +## Laravel Boost +- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them. + +## Artisan +- Use the `list-artisan-commands` tool when you need to call an Artisan command to double check the available parameters. + +## URLs +- Whenever you share a project URL with the user you should use the `get-absolute-url` tool to ensure you're using the correct scheme, domain / IP, and port. + +## Tinker / Debugging +- You should use the `tinker` tool when you need to execute 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 With the `browser-logs` Tool +- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost. +- Only recent browser logs will be useful - ignore old logs. + +## Searching Documentation (Critically Important) +- 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 on if you know you need docs for particular packages. +- The 'search-docs' tool is perfect for all Laravel related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc. +- You must use this tool to search for Laravel-ecosystem documentation before falling back to other approaches. +- Search the documentation before making code changes to ensure we are taking the correct approach. +- Use multiple, broad, simple, topic based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`. +- Do not add package names to queries - package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`. + +### Available Search Syntax +- You can and should pass multiple queries at once. The most relevant results will be returned first. + +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 "rate" AND "limit" +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 + + +=== php rules === + +## PHP + +- Always use curly braces for control structures, even if it has one line. + +### Constructors +- Use PHP 8 constructor property promotion in `__construct()`. + - public function __construct(public GitHub $github) { } +- Do not allow empty `__construct()` methods with zero parameters. + +### Type Declarations +- Always use explicit return type declarations for methods and functions. +- Use appropriate PHP type hints for method parameters. + + +protected function isAccessible(User $user, ?string $path = null): bool +{ + ... +} + + +## Comments +- Prefer PHPDoc blocks over comments. Never use comments within the code itself unless there is something _very_ complex going on. + +## PHPDoc Blocks +- Add useful array shape type definitions for arrays when appropriate. + +## Enums +- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`. + + +=== filament/core rules === + +## Filament +- Filament is used by this application, check how and where to follow existing application conventions. +- 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. +- 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. +- Utilize static `make()` methods for consistent component initialization. + +### Artisan +- 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. +- Inspect the required options, always pass `--no-interaction`, and valid arguments for other options when applicable. + +### Filament's Core Features +- 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. +- Forms: Dynamic forms rendered within other features, such as resources, action modals, table filters, and more. +- Infolists: Read-only lists of data. +- Notifications: Flash notifications displayed to users within the application. +- Panels: The top-level container in Filament that can include all other features like pages, resources, forms, tables, notifications, actions, infolists, and widgets. +- Resources: Static classes that are used to build CRUD interfaces for Eloquent models. Typically live in `app/Filament/Resources`. +- Schemas: Represent components that define the structure and behavior of the UI, such as forms, tables, or lists. +- Tables: Interactive tables with filtering, sorting, pagination, and more. +- Widgets: Small component included within dashboards, often used for displaying data in charts, tables, or as a stat. + +### Relationships +- 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`: + + +Forms\Components\Select::make('user_id') + ->label('Author') + ->relationship('author') + ->required(), + + + +## Testing +- It's important to test Filament functionality for user satisfaction. +- Ensure that you are authenticated to access the application within the test. +- Filament uses Livewire, so start assertions with `livewire()` or `Livewire::test()`. + +### Example Tests + + + livewire(ListUsers::class) + ->assertCanSeeTableRecords($users) + ->searchTable($users->first()->name) + ->assertCanSeeTableRecords($users->take(1)) + ->assertCanNotSeeTableRecords($users->skip(1)) + ->searchTable($users->last()->email) + ->assertCanSeeTableRecords($users->take(-1)) + ->assertCanNotSeeTableRecords($users->take($users->count() - 1)); + + + + livewire(CreateUser::class) + ->fillForm([ + 'name' => 'Howdy', + 'email' => 'howdy@example.com', + ]) + ->call('create') + ->assertNotified() + ->assertRedirect(); + + assertDatabaseHas(User::class, [ + 'name' => 'Howdy', + 'email' => 'howdy@example.com', + ]); + + + + use Filament\Facades\Filament; + + Filament::setCurrentPanel('app'); + + + + livewire(EditInvoice::class, [ + 'invoice' => $invoice, + ])->callAction('send'); + + expect($invoice->refresh())->isSent()->toBeTrue(); + + + +=== filament/v3 rules === + +## Filament 3 + +## Version 3 Changes To Focus On +- Resources are located in `app/Filament/Resources/` directory. +- Resource pages (List, Create, Edit) are auto-generated within the resource's directory - e.g., `app/Filament/Resources/PostResource/Pages/`. +- Forms use the `Forms\Components` namespace for form fields. +- Tables use the `Tables\Columns` namespace for table columns. +- A new `Filament\Forms\Components\RichEditor` component is available. +- Form and table schemas now use fluent method chaining. +- Added `php artisan filament:optimize` command for production optimization. +- Requires implementing `FilamentUser` contract for production access control. + + +=== laravel/core rules === + +## Do Things the Laravel Way + +- 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. +- If you're creating a generic PHP class, use `artisan make:class`. +- 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. + +### Database +- Always use proper Eloquent relationship methods with return type hints. Prefer relationship methods over raw queries or manual joins. +- Use Eloquent models and relationships before suggesting raw database queries +- Avoid `DB::`; prefer `Model::query()`. Generate code that leverages Laravel's ORM capabilities rather than bypassing them. +- Generate code that prevents N+1 query problems by using eager loading. +- Use Laravel's query builder for very complex database operations. + +### Model Creation +- 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 `php artisan make:model`. + +### APIs & Eloquent Resources +- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention. + +### Controllers & Validation +- Always create Form Request classes for validation rather than inline validation in controllers. Include both validation rules and custom error messages. +- Check sibling Form Requests to see if the application uses array or string based validation rules. + +### Queues +- Use queued jobs for time-consuming operations with the `ShouldQueue` interface. + +### Authentication & Authorization +- Use Laravel's built-in authentication and authorization features (gates, policies, Sanctum, etc.). + +### URL Generation +- When generating links to other pages, prefer named routes and the `route()` function. + +### Configuration +- Use environment variables only in configuration files - never use the `env()` function directly outside of config files. 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. +- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`. +- When creating tests, make use of `php artisan make:test [options] ` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests. + +### 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`. + + +=== laravel/v10 rules === + +## Laravel 10 + +- Use the `search-docs` tool to get version specific documentation. +- Middleware typically live in `app/Http/Middleware/` and service providers in `app/Providers/`. +- There is no `bootstrap/app.php` application configuration in Laravel 10: + - Middleware registration is in `app/Http/Kernel.php` + - Exception handling is in `app/Exceptions/Handler.php` + - Console commands and schedule registration is in `app/Console/Kernel.php` + - Rate limits likely exist in `RouteServiceProvider` or `app/Http/Kernel.php` +- When using Eloquent model casts, you must use `protected $casts = [];` and not the `casts()` method. The `casts()` method isn't available on models in Laravel 10. + + +=== livewire/core rules === + +## Livewire Core +- Use the `search-docs` tool to find exact version specific documentation for how to write Livewire & Livewire tests. +- Use the `php artisan make:livewire [Posts\\CreatePost]` artisan command to create new components +- State should live on the server, with the UI reflecting it. +- All Livewire requests hit the Laravel backend, they're like regular HTTP requests. Always validate form data, and run authorization checks in Livewire actions. + +## Livewire Best Practices +- Livewire components require a single root element. +- Use `wire:loading` and `wire:dirty` for delightful loading states. +- Add `wire:key` in loops: + + ```blade + @foreach ($items as $item) +
+ {{ $item->name }} +
+ @endforeach + ``` + +- Prefer lifecycle hooks like `mount()`, `updatedFoo()`) for initialization and reactive side effects: + + + public function mount(User $user) { $this->user = $user; } + public function updatedSearch() { $this->resetPage(); } + + + +## Testing Livewire + + + Livewire::test(Counter::class) + ->assertSet('count', 0) + ->call('increment') + ->assertSet('count', 1) + ->assertSee(1) + ->assertStatus(200); + + + + + $this->get('/posts/create') + ->assertSeeLivewire(CreatePost::class); + + + +=== livewire/v3 rules === + +## Livewire 3 + +### Key Changes From Livewire 2 +- These things changed in Livewire 2, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions. + - Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default. + - Components now use the `App\Livewire` namespace (not `App\Http\Livewire`). + - Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`). + - Use the `components.layouts.app` view as the typical layout path (not `layouts.app`). + +### New Directives +- `wire:show`, `wire:transition`, `wire:cloak`, `wire:offline`, `wire:target` are available for use. Use the documentation to find usage examples. + +### Alpine +- Alpine is now included with Livewire, don't manually include Alpine.js. +- Plugins included with Alpine: persist, intersect, collapse, and focus. + +### Lifecycle Hooks +- You can listen for `livewire:init` to hook into Livewire initialization, and `fail.status === 419` for the page expiring: + + +document.addEventListener('livewire:init', function () { + Livewire.hook('request', ({ fail }) => { + if (fail && fail.status === 419) { + alert('Your session expired'); + } + }); + + Livewire.hook('message.failed', (message, component) => { + console.error(message); + }); +}); + + + +=== pint/core rules === + +## Laravel Pint Code Formatter + +- You must run `vendor/bin/pint --dirty` before finalizing changes to ensure your code matches the project's expected style. +- Do not run `vendor/bin/pint --test`, simply run `vendor/bin/pint` to fix any formatting issues. + + +=== tailwindcss/core rules === + +## Tailwind Core + +- Use Tailwind CSS classes to style HTML, check and use existing tailwind conventions within the project before writing your own. +- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc..) +- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, group elements logically +- You can use the `search-docs` tool to get exact examples from the official documentation when needed. + +### Spacing +- When listing items, use gap utilities for spacing, don't use margins. + + +
+
Superior
+
Michigan
+
Erie
+
+
+ + +### Dark Mode +- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`. + + +=== tailwindcss/v4 rules === + +## Tailwind 4 + +- Always use Tailwind CSS v4 - do not use the deprecated utilities. +- `corePlugins` is not supported in Tailwind v4. +- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3: + + + + +### Replaced Utilities +- Tailwind v4 removed deprecated utilities. Do not use the deprecated option - use the replacement. +- Opacity values are still numeric. + +| Deprecated | Replacement | +|------------+--------------| +| bg-opacity-* | bg-black/* | +| text-opacity-* | text-black/* | +| border-opacity-* | border-black/* | +| divide-opacity-* | divide-black/* | +| ring-opacity-* | ring-black/* | +| placeholder-opacity-* | placeholder-black/* | +| flex-shrink-* | shrink-* | +| flex-grow-* | grow-* | +| overflow-ellipsis | text-ellipsis | +| decoration-slice | box-decoration-slice | +| decoration-clone | box-decoration-clone | + + +=== tests rules === + +## Test Enforcement + +- 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. +- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test` with a specific filename or filter. +
\ No newline at end of file diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..bc83ebc7 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,427 @@ + +=== foundation rules === + +# Laravel Boost Guidelines + +The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to enhance the user's satisfaction building Laravel applications. + +## Foundational Context +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. + +- php - 8.4.11 +- filament/filament (FILAMENT) - v3 +- laravel/framework (LARAVEL) - v10 +- laravel/prompts (PROMPTS) - v0 +- livewire/livewire (LIVEWIRE) - v3 +- laravel/pint (PINT) - v1 +- alpinejs (ALPINEJS) - v3 +- tailwindcss (TAILWINDCSS) - v4 + + +## Conventions +- 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. +- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`. +- Check for existing components to reuse before writing a new one. + +## 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. + +## Application Structure & Architecture +- Stick to existing directory structure - don't create new base folders without approval. +- Do not change the application's dependencies without approval. + +## Frontend Bundling +- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them. + +## Replies +- Be concise in your explanations - focus on what's important rather than explaining obvious details. + +## Documentation Files +- You must only create documentation files if explicitly requested by the user. + + +=== boost rules === + +## Laravel Boost +- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them. + +## Artisan +- Use the `list-artisan-commands` tool when you need to call an Artisan command to double check the available parameters. + +## URLs +- Whenever you share a project URL with the user you should use the `get-absolute-url` tool to ensure you're using the correct scheme, domain / IP, and port. + +## Tinker / Debugging +- You should use the `tinker` tool when you need to execute 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 With the `browser-logs` Tool +- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost. +- Only recent browser logs will be useful - ignore old logs. + +## Searching Documentation (Critically Important) +- 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 on if you know you need docs for particular packages. +- The 'search-docs' tool is perfect for all Laravel related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc. +- You must use this tool to search for Laravel-ecosystem documentation before falling back to other approaches. +- Search the documentation before making code changes to ensure we are taking the correct approach. +- Use multiple, broad, simple, topic based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`. +- Do not add package names to queries - package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`. + +### Available Search Syntax +- You can and should pass multiple queries at once. The most relevant results will be returned first. + +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 "rate" AND "limit" +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 + + +=== php rules === + +## PHP + +- Always use curly braces for control structures, even if it has one line. + +### Constructors +- Use PHP 8 constructor property promotion in `__construct()`. + - public function __construct(public GitHub $github) { } +- Do not allow empty `__construct()` methods with zero parameters. + +### Type Declarations +- Always use explicit return type declarations for methods and functions. +- Use appropriate PHP type hints for method parameters. + + +protected function isAccessible(User $user, ?string $path = null): bool +{ + ... +} + + +## Comments +- Prefer PHPDoc blocks over comments. Never use comments within the code itself unless there is something _very_ complex going on. + +## PHPDoc Blocks +- Add useful array shape type definitions for arrays when appropriate. + +## Enums +- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`. + + +=== filament/core rules === + +## Filament +- Filament is used by this application, check how and where to follow existing application conventions. +- 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. +- 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. +- Utilize static `make()` methods for consistent component initialization. + +### Artisan +- 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. +- Inspect the required options, always pass `--no-interaction`, and valid arguments for other options when applicable. + +### Filament's Core Features +- 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. +- Forms: Dynamic forms rendered within other features, such as resources, action modals, table filters, and more. +- Infolists: Read-only lists of data. +- Notifications: Flash notifications displayed to users within the application. +- Panels: The top-level container in Filament that can include all other features like pages, resources, forms, tables, notifications, actions, infolists, and widgets. +- Resources: Static classes that are used to build CRUD interfaces for Eloquent models. Typically live in `app/Filament/Resources`. +- Schemas: Represent components that define the structure and behavior of the UI, such as forms, tables, or lists. +- Tables: Interactive tables with filtering, sorting, pagination, and more. +- Widgets: Small component included within dashboards, often used for displaying data in charts, tables, or as a stat. + +### Relationships +- 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`: + + +Forms\Components\Select::make('user_id') + ->label('Author') + ->relationship('author') + ->required(), + + + +## Testing +- It's important to test Filament functionality for user satisfaction. +- Ensure that you are authenticated to access the application within the test. +- Filament uses Livewire, so start assertions with `livewire()` or `Livewire::test()`. + +### Example Tests + + + livewire(ListUsers::class) + ->assertCanSeeTableRecords($users) + ->searchTable($users->first()->name) + ->assertCanSeeTableRecords($users->take(1)) + ->assertCanNotSeeTableRecords($users->skip(1)) + ->searchTable($users->last()->email) + ->assertCanSeeTableRecords($users->take(-1)) + ->assertCanNotSeeTableRecords($users->take($users->count() - 1)); + + + + livewire(CreateUser::class) + ->fillForm([ + 'name' => 'Howdy', + 'email' => 'howdy@example.com', + ]) + ->call('create') + ->assertNotified() + ->assertRedirect(); + + assertDatabaseHas(User::class, [ + 'name' => 'Howdy', + 'email' => 'howdy@example.com', + ]); + + + + use Filament\Facades\Filament; + + Filament::setCurrentPanel('app'); + + + + livewire(EditInvoice::class, [ + 'invoice' => $invoice, + ])->callAction('send'); + + expect($invoice->refresh())->isSent()->toBeTrue(); + + + +=== filament/v3 rules === + +## Filament 3 + +## Version 3 Changes To Focus On +- Resources are located in `app/Filament/Resources/` directory. +- Resource pages (List, Create, Edit) are auto-generated within the resource's directory - e.g., `app/Filament/Resources/PostResource/Pages/`. +- Forms use the `Forms\Components` namespace for form fields. +- Tables use the `Tables\Columns` namespace for table columns. +- A new `Filament\Forms\Components\RichEditor` component is available. +- Form and table schemas now use fluent method chaining. +- Added `php artisan filament:optimize` command for production optimization. +- Requires implementing `FilamentUser` contract for production access control. + + +=== laravel/core rules === + +## Do Things the Laravel Way + +- 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. +- If you're creating a generic PHP class, use `artisan make:class`. +- 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. + +### Database +- Always use proper Eloquent relationship methods with return type hints. Prefer relationship methods over raw queries or manual joins. +- Use Eloquent models and relationships before suggesting raw database queries +- Avoid `DB::`; prefer `Model::query()`. Generate code that leverages Laravel's ORM capabilities rather than bypassing them. +- Generate code that prevents N+1 query problems by using eager loading. +- Use Laravel's query builder for very complex database operations. + +### Model Creation +- 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 `php artisan make:model`. + +### APIs & Eloquent Resources +- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention. + +### Controllers & Validation +- Always create Form Request classes for validation rather than inline validation in controllers. Include both validation rules and custom error messages. +- Check sibling Form Requests to see if the application uses array or string based validation rules. + +### Queues +- Use queued jobs for time-consuming operations with the `ShouldQueue` interface. + +### Authentication & Authorization +- Use Laravel's built-in authentication and authorization features (gates, policies, Sanctum, etc.). + +### URL Generation +- When generating links to other pages, prefer named routes and the `route()` function. + +### Configuration +- Use environment variables only in configuration files - never use the `env()` function directly outside of config files. 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. +- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`. +- When creating tests, make use of `php artisan make:test [options] ` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests. + +### 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`. + + +=== laravel/v10 rules === + +## Laravel 10 + +- Use the `search-docs` tool to get version specific documentation. +- Middleware typically live in `app/Http/Middleware/` and service providers in `app/Providers/`. +- There is no `bootstrap/app.php` application configuration in Laravel 10: + - Middleware registration is in `app/Http/Kernel.php` + - Exception handling is in `app/Exceptions/Handler.php` + - Console commands and schedule registration is in `app/Console/Kernel.php` + - Rate limits likely exist in `RouteServiceProvider` or `app/Http/Kernel.php` +- When using Eloquent model casts, you must use `protected $casts = [];` and not the `casts()` method. The `casts()` method isn't available on models in Laravel 10. + + +=== livewire/core rules === + +## Livewire Core +- Use the `search-docs` tool to find exact version specific documentation for how to write Livewire & Livewire tests. +- Use the `php artisan make:livewire [Posts\\CreatePost]` artisan command to create new components +- State should live on the server, with the UI reflecting it. +- All Livewire requests hit the Laravel backend, they're like regular HTTP requests. Always validate form data, and run authorization checks in Livewire actions. + +## Livewire Best Practices +- Livewire components require a single root element. +- Use `wire:loading` and `wire:dirty` for delightful loading states. +- Add `wire:key` in loops: + + ```blade + @foreach ($items as $item) +
+ {{ $item->name }} +
+ @endforeach + ``` + +- Prefer lifecycle hooks like `mount()`, `updatedFoo()`) for initialization and reactive side effects: + + + public function mount(User $user) { $this->user = $user; } + public function updatedSearch() { $this->resetPage(); } + + + +## Testing Livewire + + + Livewire::test(Counter::class) + ->assertSet('count', 0) + ->call('increment') + ->assertSet('count', 1) + ->assertSee(1) + ->assertStatus(200); + + + + + $this->get('/posts/create') + ->assertSeeLivewire(CreatePost::class); + + + +=== livewire/v3 rules === + +## Livewire 3 + +### Key Changes From Livewire 2 +- These things changed in Livewire 2, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions. + - Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default. + - Components now use the `App\Livewire` namespace (not `App\Http\Livewire`). + - Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`). + - Use the `components.layouts.app` view as the typical layout path (not `layouts.app`). + +### New Directives +- `wire:show`, `wire:transition`, `wire:cloak`, `wire:offline`, `wire:target` are available for use. Use the documentation to find usage examples. + +### Alpine +- Alpine is now included with Livewire, don't manually include Alpine.js. +- Plugins included with Alpine: persist, intersect, collapse, and focus. + +### Lifecycle Hooks +- You can listen for `livewire:init` to hook into Livewire initialization, and `fail.status === 419` for the page expiring: + + +document.addEventListener('livewire:init', function () { + Livewire.hook('request', ({ fail }) => { + if (fail && fail.status === 419) { + alert('Your session expired'); + } + }); + + Livewire.hook('message.failed', (message, component) => { + console.error(message); + }); +}); + + + +=== pint/core rules === + +## Laravel Pint Code Formatter + +- You must run `vendor/bin/pint --dirty` before finalizing changes to ensure your code matches the project's expected style. +- Do not run `vendor/bin/pint --test`, simply run `vendor/bin/pint` to fix any formatting issues. + + +=== tailwindcss/core rules === + +## Tailwind Core + +- Use Tailwind CSS classes to style HTML, check and use existing tailwind conventions within the project before writing your own. +- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc..) +- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, group elements logically +- You can use the `search-docs` tool to get exact examples from the official documentation when needed. + +### Spacing +- When listing items, use gap utilities for spacing, don't use margins. + + +
+
Superior
+
Michigan
+
Erie
+
+
+ + +### Dark Mode +- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`. + + +=== tailwindcss/v4 rules === + +## Tailwind 4 + +- Always use Tailwind CSS v4 - do not use the deprecated utilities. +- `corePlugins` is not supported in Tailwind v4. +- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3: + + + + +### Replaced Utilities +- Tailwind v4 removed deprecated utilities. Do not use the deprecated option - use the replacement. +- Opacity values are still numeric. + +| Deprecated | Replacement | +|------------+--------------| +| bg-opacity-* | bg-black/* | +| text-opacity-* | text-black/* | +| border-opacity-* | border-black/* | +| divide-opacity-* | divide-black/* | +| ring-opacity-* | ring-black/* | +| placeholder-opacity-* | placeholder-black/* | +| flex-shrink-* | shrink-* | +| flex-grow-* | grow-* | +| overflow-ellipsis | text-ellipsis | +| decoration-slice | box-decoration-slice | +| decoration-clone | box-decoration-clone | + + +=== tests rules === + +## Test Enforcement + +- 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. +- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test` with a specific filename or filter. +
\ No newline at end of file diff --git a/.junie/guidelines.md b/.junie/guidelines.md new file mode 100644 index 00000000..bc83ebc7 --- /dev/null +++ b/.junie/guidelines.md @@ -0,0 +1,427 @@ + +=== foundation rules === + +# Laravel Boost Guidelines + +The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to enhance the user's satisfaction building Laravel applications. + +## Foundational Context +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. + +- php - 8.4.11 +- filament/filament (FILAMENT) - v3 +- laravel/framework (LARAVEL) - v10 +- laravel/prompts (PROMPTS) - v0 +- livewire/livewire (LIVEWIRE) - v3 +- laravel/pint (PINT) - v1 +- alpinejs (ALPINEJS) - v3 +- tailwindcss (TAILWINDCSS) - v4 + + +## Conventions +- 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. +- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`. +- Check for existing components to reuse before writing a new one. + +## 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. + +## Application Structure & Architecture +- Stick to existing directory structure - don't create new base folders without approval. +- Do not change the application's dependencies without approval. + +## Frontend Bundling +- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them. + +## Replies +- Be concise in your explanations - focus on what's important rather than explaining obvious details. + +## Documentation Files +- You must only create documentation files if explicitly requested by the user. + + +=== boost rules === + +## Laravel Boost +- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them. + +## Artisan +- Use the `list-artisan-commands` tool when you need to call an Artisan command to double check the available parameters. + +## URLs +- Whenever you share a project URL with the user you should use the `get-absolute-url` tool to ensure you're using the correct scheme, domain / IP, and port. + +## Tinker / Debugging +- You should use the `tinker` tool when you need to execute 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 With the `browser-logs` Tool +- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost. +- Only recent browser logs will be useful - ignore old logs. + +## Searching Documentation (Critically Important) +- 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 on if you know you need docs for particular packages. +- The 'search-docs' tool is perfect for all Laravel related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc. +- You must use this tool to search for Laravel-ecosystem documentation before falling back to other approaches. +- Search the documentation before making code changes to ensure we are taking the correct approach. +- Use multiple, broad, simple, topic based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`. +- Do not add package names to queries - package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`. + +### Available Search Syntax +- You can and should pass multiple queries at once. The most relevant results will be returned first. + +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 "rate" AND "limit" +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 + + +=== php rules === + +## PHP + +- Always use curly braces for control structures, even if it has one line. + +### Constructors +- Use PHP 8 constructor property promotion in `__construct()`. + - public function __construct(public GitHub $github) { } +- Do not allow empty `__construct()` methods with zero parameters. + +### Type Declarations +- Always use explicit return type declarations for methods and functions. +- Use appropriate PHP type hints for method parameters. + + +protected function isAccessible(User $user, ?string $path = null): bool +{ + ... +} + + +## Comments +- Prefer PHPDoc blocks over comments. Never use comments within the code itself unless there is something _very_ complex going on. + +## PHPDoc Blocks +- Add useful array shape type definitions for arrays when appropriate. + +## Enums +- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`. + + +=== filament/core rules === + +## Filament +- Filament is used by this application, check how and where to follow existing application conventions. +- 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. +- 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. +- Utilize static `make()` methods for consistent component initialization. + +### Artisan +- 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. +- Inspect the required options, always pass `--no-interaction`, and valid arguments for other options when applicable. + +### Filament's Core Features +- 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. +- Forms: Dynamic forms rendered within other features, such as resources, action modals, table filters, and more. +- Infolists: Read-only lists of data. +- Notifications: Flash notifications displayed to users within the application. +- Panels: The top-level container in Filament that can include all other features like pages, resources, forms, tables, notifications, actions, infolists, and widgets. +- Resources: Static classes that are used to build CRUD interfaces for Eloquent models. Typically live in `app/Filament/Resources`. +- Schemas: Represent components that define the structure and behavior of the UI, such as forms, tables, or lists. +- Tables: Interactive tables with filtering, sorting, pagination, and more. +- Widgets: Small component included within dashboards, often used for displaying data in charts, tables, or as a stat. + +### Relationships +- 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`: + + +Forms\Components\Select::make('user_id') + ->label('Author') + ->relationship('author') + ->required(), + + + +## Testing +- It's important to test Filament functionality for user satisfaction. +- Ensure that you are authenticated to access the application within the test. +- Filament uses Livewire, so start assertions with `livewire()` or `Livewire::test()`. + +### Example Tests + + + livewire(ListUsers::class) + ->assertCanSeeTableRecords($users) + ->searchTable($users->first()->name) + ->assertCanSeeTableRecords($users->take(1)) + ->assertCanNotSeeTableRecords($users->skip(1)) + ->searchTable($users->last()->email) + ->assertCanSeeTableRecords($users->take(-1)) + ->assertCanNotSeeTableRecords($users->take($users->count() - 1)); + + + + livewire(CreateUser::class) + ->fillForm([ + 'name' => 'Howdy', + 'email' => 'howdy@example.com', + ]) + ->call('create') + ->assertNotified() + ->assertRedirect(); + + assertDatabaseHas(User::class, [ + 'name' => 'Howdy', + 'email' => 'howdy@example.com', + ]); + + + + use Filament\Facades\Filament; + + Filament::setCurrentPanel('app'); + + + + livewire(EditInvoice::class, [ + 'invoice' => $invoice, + ])->callAction('send'); + + expect($invoice->refresh())->isSent()->toBeTrue(); + + + +=== filament/v3 rules === + +## Filament 3 + +## Version 3 Changes To Focus On +- Resources are located in `app/Filament/Resources/` directory. +- Resource pages (List, Create, Edit) are auto-generated within the resource's directory - e.g., `app/Filament/Resources/PostResource/Pages/`. +- Forms use the `Forms\Components` namespace for form fields. +- Tables use the `Tables\Columns` namespace for table columns. +- A new `Filament\Forms\Components\RichEditor` component is available. +- Form and table schemas now use fluent method chaining. +- Added `php artisan filament:optimize` command for production optimization. +- Requires implementing `FilamentUser` contract for production access control. + + +=== laravel/core rules === + +## Do Things the Laravel Way + +- 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. +- If you're creating a generic PHP class, use `artisan make:class`. +- 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. + +### Database +- Always use proper Eloquent relationship methods with return type hints. Prefer relationship methods over raw queries or manual joins. +- Use Eloquent models and relationships before suggesting raw database queries +- Avoid `DB::`; prefer `Model::query()`. Generate code that leverages Laravel's ORM capabilities rather than bypassing them. +- Generate code that prevents N+1 query problems by using eager loading. +- Use Laravel's query builder for very complex database operations. + +### Model Creation +- 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 `php artisan make:model`. + +### APIs & Eloquent Resources +- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention. + +### Controllers & Validation +- Always create Form Request classes for validation rather than inline validation in controllers. Include both validation rules and custom error messages. +- Check sibling Form Requests to see if the application uses array or string based validation rules. + +### Queues +- Use queued jobs for time-consuming operations with the `ShouldQueue` interface. + +### Authentication & Authorization +- Use Laravel's built-in authentication and authorization features (gates, policies, Sanctum, etc.). + +### URL Generation +- When generating links to other pages, prefer named routes and the `route()` function. + +### Configuration +- Use environment variables only in configuration files - never use the `env()` function directly outside of config files. 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. +- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`. +- When creating tests, make use of `php artisan make:test [options] ` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests. + +### 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`. + + +=== laravel/v10 rules === + +## Laravel 10 + +- Use the `search-docs` tool to get version specific documentation. +- Middleware typically live in `app/Http/Middleware/` and service providers in `app/Providers/`. +- There is no `bootstrap/app.php` application configuration in Laravel 10: + - Middleware registration is in `app/Http/Kernel.php` + - Exception handling is in `app/Exceptions/Handler.php` + - Console commands and schedule registration is in `app/Console/Kernel.php` + - Rate limits likely exist in `RouteServiceProvider` or `app/Http/Kernel.php` +- When using Eloquent model casts, you must use `protected $casts = [];` and not the `casts()` method. The `casts()` method isn't available on models in Laravel 10. + + +=== livewire/core rules === + +## Livewire Core +- Use the `search-docs` tool to find exact version specific documentation for how to write Livewire & Livewire tests. +- Use the `php artisan make:livewire [Posts\\CreatePost]` artisan command to create new components +- State should live on the server, with the UI reflecting it. +- All Livewire requests hit the Laravel backend, they're like regular HTTP requests. Always validate form data, and run authorization checks in Livewire actions. + +## Livewire Best Practices +- Livewire components require a single root element. +- Use `wire:loading` and `wire:dirty` for delightful loading states. +- Add `wire:key` in loops: + + ```blade + @foreach ($items as $item) +
+ {{ $item->name }} +
+ @endforeach + ``` + +- Prefer lifecycle hooks like `mount()`, `updatedFoo()`) for initialization and reactive side effects: + + + public function mount(User $user) { $this->user = $user; } + public function updatedSearch() { $this->resetPage(); } + + + +## Testing Livewire + + + Livewire::test(Counter::class) + ->assertSet('count', 0) + ->call('increment') + ->assertSet('count', 1) + ->assertSee(1) + ->assertStatus(200); + + + + + $this->get('/posts/create') + ->assertSeeLivewire(CreatePost::class); + + + +=== livewire/v3 rules === + +## Livewire 3 + +### Key Changes From Livewire 2 +- These things changed in Livewire 2, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions. + - Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default. + - Components now use the `App\Livewire` namespace (not `App\Http\Livewire`). + - Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`). + - Use the `components.layouts.app` view as the typical layout path (not `layouts.app`). + +### New Directives +- `wire:show`, `wire:transition`, `wire:cloak`, `wire:offline`, `wire:target` are available for use. Use the documentation to find usage examples. + +### Alpine +- Alpine is now included with Livewire, don't manually include Alpine.js. +- Plugins included with Alpine: persist, intersect, collapse, and focus. + +### Lifecycle Hooks +- You can listen for `livewire:init` to hook into Livewire initialization, and `fail.status === 419` for the page expiring: + + +document.addEventListener('livewire:init', function () { + Livewire.hook('request', ({ fail }) => { + if (fail && fail.status === 419) { + alert('Your session expired'); + } + }); + + Livewire.hook('message.failed', (message, component) => { + console.error(message); + }); +}); + + + +=== pint/core rules === + +## Laravel Pint Code Formatter + +- You must run `vendor/bin/pint --dirty` before finalizing changes to ensure your code matches the project's expected style. +- Do not run `vendor/bin/pint --test`, simply run `vendor/bin/pint` to fix any formatting issues. + + +=== tailwindcss/core rules === + +## Tailwind Core + +- Use Tailwind CSS classes to style HTML, check and use existing tailwind conventions within the project before writing your own. +- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc..) +- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, group elements logically +- You can use the `search-docs` tool to get exact examples from the official documentation when needed. + +### Spacing +- When listing items, use gap utilities for spacing, don't use margins. + + +
+
Superior
+
Michigan
+
Erie
+
+
+ + +### Dark Mode +- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`. + + +=== tailwindcss/v4 rules === + +## Tailwind 4 + +- Always use Tailwind CSS v4 - do not use the deprecated utilities. +- `corePlugins` is not supported in Tailwind v4. +- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3: + + + + +### Replaced Utilities +- Tailwind v4 removed deprecated utilities. Do not use the deprecated option - use the replacement. +- Opacity values are still numeric. + +| Deprecated | Replacement | +|------------+--------------| +| bg-opacity-* | bg-black/* | +| text-opacity-* | text-black/* | +| border-opacity-* | border-black/* | +| divide-opacity-* | divide-black/* | +| ring-opacity-* | ring-black/* | +| placeholder-opacity-* | placeholder-black/* | +| flex-shrink-* | shrink-* | +| flex-grow-* | grow-* | +| overflow-ellipsis | text-ellipsis | +| decoration-slice | box-decoration-slice | +| decoration-clone | box-decoration-clone | + + +=== tests rules === + +## Test Enforcement + +- 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. +- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test` with a specific filename or filter. +
\ No newline at end of file diff --git a/.junie/mcp/mcp.json b/.junie/mcp/mcp.json new file mode 100644 index 00000000..7f63ff3c --- /dev/null +++ b/.junie/mcp/mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "laravel-boost": { + "command": "/usr/bin/php8.4", + "args": [ + "/home/hassan/code/nativephp.com/artisan", + "boost:mcp" + ] + } + } +} \ No newline at end of file diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 00000000..ea301954 --- /dev/null +++ b/.mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "laravel-boost": { + "command": "php", + "args": [ + "./artisan", + "boost:mcp" + ] + } + } +} \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 2ea9bc71..35a144fa 100644 --- a/.prettierrc +++ b/.prettierrc @@ -8,7 +8,7 @@ } } ], - "tailwindConfig": "./tailwind.config.js", + "tailwindStylesheet": "./resources/css/app.css", "singleQuote": true, "semi": false, "trailingComma": "all", diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..bc83ebc7 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,427 @@ + +=== foundation rules === + +# Laravel Boost Guidelines + +The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to enhance the user's satisfaction building Laravel applications. + +## Foundational Context +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. + +- php - 8.4.11 +- filament/filament (FILAMENT) - v3 +- laravel/framework (LARAVEL) - v10 +- laravel/prompts (PROMPTS) - v0 +- livewire/livewire (LIVEWIRE) - v3 +- laravel/pint (PINT) - v1 +- alpinejs (ALPINEJS) - v3 +- tailwindcss (TAILWINDCSS) - v4 + + +## Conventions +- 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. +- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`. +- Check for existing components to reuse before writing a new one. + +## 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. + +## Application Structure & Architecture +- Stick to existing directory structure - don't create new base folders without approval. +- Do not change the application's dependencies without approval. + +## Frontend Bundling +- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them. + +## Replies +- Be concise in your explanations - focus on what's important rather than explaining obvious details. + +## Documentation Files +- You must only create documentation files if explicitly requested by the user. + + +=== boost rules === + +## Laravel Boost +- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them. + +## Artisan +- Use the `list-artisan-commands` tool when you need to call an Artisan command to double check the available parameters. + +## URLs +- Whenever you share a project URL with the user you should use the `get-absolute-url` tool to ensure you're using the correct scheme, domain / IP, and port. + +## Tinker / Debugging +- You should use the `tinker` tool when you need to execute 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 With the `browser-logs` Tool +- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost. +- Only recent browser logs will be useful - ignore old logs. + +## Searching Documentation (Critically Important) +- 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 on if you know you need docs for particular packages. +- The 'search-docs' tool is perfect for all Laravel related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc. +- You must use this tool to search for Laravel-ecosystem documentation before falling back to other approaches. +- Search the documentation before making code changes to ensure we are taking the correct approach. +- Use multiple, broad, simple, topic based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`. +- Do not add package names to queries - package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`. + +### Available Search Syntax +- You can and should pass multiple queries at once. The most relevant results will be returned first. + +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 "rate" AND "limit" +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 + + +=== php rules === + +## PHP + +- Always use curly braces for control structures, even if it has one line. + +### Constructors +- Use PHP 8 constructor property promotion in `__construct()`. + - public function __construct(public GitHub $github) { } +- Do not allow empty `__construct()` methods with zero parameters. + +### Type Declarations +- Always use explicit return type declarations for methods and functions. +- Use appropriate PHP type hints for method parameters. + + +protected function isAccessible(User $user, ?string $path = null): bool +{ + ... +} + + +## Comments +- Prefer PHPDoc blocks over comments. Never use comments within the code itself unless there is something _very_ complex going on. + +## PHPDoc Blocks +- Add useful array shape type definitions for arrays when appropriate. + +## Enums +- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`. + + +=== filament/core rules === + +## Filament +- Filament is used by this application, check how and where to follow existing application conventions. +- 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. +- 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. +- Utilize static `make()` methods for consistent component initialization. + +### Artisan +- 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. +- Inspect the required options, always pass `--no-interaction`, and valid arguments for other options when applicable. + +### Filament's Core Features +- 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. +- Forms: Dynamic forms rendered within other features, such as resources, action modals, table filters, and more. +- Infolists: Read-only lists of data. +- Notifications: Flash notifications displayed to users within the application. +- Panels: The top-level container in Filament that can include all other features like pages, resources, forms, tables, notifications, actions, infolists, and widgets. +- Resources: Static classes that are used to build CRUD interfaces for Eloquent models. Typically live in `app/Filament/Resources`. +- Schemas: Represent components that define the structure and behavior of the UI, such as forms, tables, or lists. +- Tables: Interactive tables with filtering, sorting, pagination, and more. +- Widgets: Small component included within dashboards, often used for displaying data in charts, tables, or as a stat. + +### Relationships +- 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`: + + +Forms\Components\Select::make('user_id') + ->label('Author') + ->relationship('author') + ->required(), + + + +## Testing +- It's important to test Filament functionality for user satisfaction. +- Ensure that you are authenticated to access the application within the test. +- Filament uses Livewire, so start assertions with `livewire()` or `Livewire::test()`. + +### Example Tests + + + livewire(ListUsers::class) + ->assertCanSeeTableRecords($users) + ->searchTable($users->first()->name) + ->assertCanSeeTableRecords($users->take(1)) + ->assertCanNotSeeTableRecords($users->skip(1)) + ->searchTable($users->last()->email) + ->assertCanSeeTableRecords($users->take(-1)) + ->assertCanNotSeeTableRecords($users->take($users->count() - 1)); + + + + livewire(CreateUser::class) + ->fillForm([ + 'name' => 'Howdy', + 'email' => 'howdy@example.com', + ]) + ->call('create') + ->assertNotified() + ->assertRedirect(); + + assertDatabaseHas(User::class, [ + 'name' => 'Howdy', + 'email' => 'howdy@example.com', + ]); + + + + use Filament\Facades\Filament; + + Filament::setCurrentPanel('app'); + + + + livewire(EditInvoice::class, [ + 'invoice' => $invoice, + ])->callAction('send'); + + expect($invoice->refresh())->isSent()->toBeTrue(); + + + +=== filament/v3 rules === + +## Filament 3 + +## Version 3 Changes To Focus On +- Resources are located in `app/Filament/Resources/` directory. +- Resource pages (List, Create, Edit) are auto-generated within the resource's directory - e.g., `app/Filament/Resources/PostResource/Pages/`. +- Forms use the `Forms\Components` namespace for form fields. +- Tables use the `Tables\Columns` namespace for table columns. +- A new `Filament\Forms\Components\RichEditor` component is available. +- Form and table schemas now use fluent method chaining. +- Added `php artisan filament:optimize` command for production optimization. +- Requires implementing `FilamentUser` contract for production access control. + + +=== laravel/core rules === + +## Do Things the Laravel Way + +- 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. +- If you're creating a generic PHP class, use `artisan make:class`. +- 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. + +### Database +- Always use proper Eloquent relationship methods with return type hints. Prefer relationship methods over raw queries or manual joins. +- Use Eloquent models and relationships before suggesting raw database queries +- Avoid `DB::`; prefer `Model::query()`. Generate code that leverages Laravel's ORM capabilities rather than bypassing them. +- Generate code that prevents N+1 query problems by using eager loading. +- Use Laravel's query builder for very complex database operations. + +### Model Creation +- 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 `php artisan make:model`. + +### APIs & Eloquent Resources +- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention. + +### Controllers & Validation +- Always create Form Request classes for validation rather than inline validation in controllers. Include both validation rules and custom error messages. +- Check sibling Form Requests to see if the application uses array or string based validation rules. + +### Queues +- Use queued jobs for time-consuming operations with the `ShouldQueue` interface. + +### Authentication & Authorization +- Use Laravel's built-in authentication and authorization features (gates, policies, Sanctum, etc.). + +### URL Generation +- When generating links to other pages, prefer named routes and the `route()` function. + +### Configuration +- Use environment variables only in configuration files - never use the `env()` function directly outside of config files. 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. +- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`. +- When creating tests, make use of `php artisan make:test [options] ` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests. + +### 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`. + + +=== laravel/v10 rules === + +## Laravel 10 + +- Use the `search-docs` tool to get version specific documentation. +- Middleware typically live in `app/Http/Middleware/` and service providers in `app/Providers/`. +- There is no `bootstrap/app.php` application configuration in Laravel 10: + - Middleware registration is in `app/Http/Kernel.php` + - Exception handling is in `app/Exceptions/Handler.php` + - Console commands and schedule registration is in `app/Console/Kernel.php` + - Rate limits likely exist in `RouteServiceProvider` or `app/Http/Kernel.php` +- When using Eloquent model casts, you must use `protected $casts = [];` and not the `casts()` method. The `casts()` method isn't available on models in Laravel 10. + + +=== livewire/core rules === + +## Livewire Core +- Use the `search-docs` tool to find exact version specific documentation for how to write Livewire & Livewire tests. +- Use the `php artisan make:livewire [Posts\\CreatePost]` artisan command to create new components +- State should live on the server, with the UI reflecting it. +- All Livewire requests hit the Laravel backend, they're like regular HTTP requests. Always validate form data, and run authorization checks in Livewire actions. + +## Livewire Best Practices +- Livewire components require a single root element. +- Use `wire:loading` and `wire:dirty` for delightful loading states. +- Add `wire:key` in loops: + + ```blade + @foreach ($items as $item) +
+ {{ $item->name }} +
+ @endforeach + ``` + +- Prefer lifecycle hooks like `mount()`, `updatedFoo()`) for initialization and reactive side effects: + + + public function mount(User $user) { $this->user = $user; } + public function updatedSearch() { $this->resetPage(); } + + + +## Testing Livewire + + + Livewire::test(Counter::class) + ->assertSet('count', 0) + ->call('increment') + ->assertSet('count', 1) + ->assertSee(1) + ->assertStatus(200); + + + + + $this->get('/posts/create') + ->assertSeeLivewire(CreatePost::class); + + + +=== livewire/v3 rules === + +## Livewire 3 + +### Key Changes From Livewire 2 +- These things changed in Livewire 2, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions. + - Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default. + - Components now use the `App\Livewire` namespace (not `App\Http\Livewire`). + - Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`). + - Use the `components.layouts.app` view as the typical layout path (not `layouts.app`). + +### New Directives +- `wire:show`, `wire:transition`, `wire:cloak`, `wire:offline`, `wire:target` are available for use. Use the documentation to find usage examples. + +### Alpine +- Alpine is now included with Livewire, don't manually include Alpine.js. +- Plugins included with Alpine: persist, intersect, collapse, and focus. + +### Lifecycle Hooks +- You can listen for `livewire:init` to hook into Livewire initialization, and `fail.status === 419` for the page expiring: + + +document.addEventListener('livewire:init', function () { + Livewire.hook('request', ({ fail }) => { + if (fail && fail.status === 419) { + alert('Your session expired'); + } + }); + + Livewire.hook('message.failed', (message, component) => { + console.error(message); + }); +}); + + + +=== pint/core rules === + +## Laravel Pint Code Formatter + +- You must run `vendor/bin/pint --dirty` before finalizing changes to ensure your code matches the project's expected style. +- Do not run `vendor/bin/pint --test`, simply run `vendor/bin/pint` to fix any formatting issues. + + +=== tailwindcss/core rules === + +## Tailwind Core + +- Use Tailwind CSS classes to style HTML, check and use existing tailwind conventions within the project before writing your own. +- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc..) +- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, group elements logically +- You can use the `search-docs` tool to get exact examples from the official documentation when needed. + +### Spacing +- When listing items, use gap utilities for spacing, don't use margins. + + +
+
Superior
+
Michigan
+
Erie
+
+
+ + +### Dark Mode +- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`. + + +=== tailwindcss/v4 rules === + +## Tailwind 4 + +- Always use Tailwind CSS v4 - do not use the deprecated utilities. +- `corePlugins` is not supported in Tailwind v4. +- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3: + + + + +### Replaced Utilities +- Tailwind v4 removed deprecated utilities. Do not use the deprecated option - use the replacement. +- Opacity values are still numeric. + +| Deprecated | Replacement | +|------------+--------------| +| bg-opacity-* | bg-black/* | +| text-opacity-* | text-black/* | +| border-opacity-* | border-black/* | +| divide-opacity-* | divide-black/* | +| ring-opacity-* | ring-black/* | +| placeholder-opacity-* | placeholder-black/* | +| flex-shrink-* | shrink-* | +| flex-grow-* | grow-* | +| overflow-ellipsis | text-ellipsis | +| decoration-slice | box-decoration-slice | +| decoration-clone | box-decoration-clone | + + +=== tests rules === + +## Test Enforcement + +- 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. +- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test` with a specific filename or filter. +
\ No newline at end of file diff --git a/app/Livewire/MobilePricing.php b/app/Livewire/MobilePricing.php index 7bded0f7..ca6cf435 100644 --- a/app/Livewire/MobilePricing.php +++ b/app/Livewire/MobilePricing.php @@ -61,7 +61,7 @@ public function createCheckoutSession(?string $plan, ?User $user = null) ->allowPromotionCodes() ->checkout([ 'success_url' => $this->successUrl(), - 'cancel_url' => route('early-adopter'), + 'cancel_url' => route('pricing'), 'consent_collection' => [ 'terms_of_service' => 'required', ], diff --git a/composer.json b/composer.json index 4050bca5..dd4a9815 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ }, "require-dev": { "fakerphp/faker": "^1.9.1", + "laravel/boost": "^1.0", "laravel/pint": "^1.0", "laravel/sail": "^1.18", "mockery/mockery": "^1.4.4", diff --git a/composer.lock b/composer.lock index 7d918b3e..03baabbd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c56c56470d31a8a40dd3d4255ddd9686", + "content-hash": "e92e65fe8e79603ace8319a36effc1db", "packages": [ { "name": "anourvalar/eloquent-serialize", @@ -9321,6 +9321,135 @@ }, "time": "2025-04-30T06:54:44+00:00" }, + { + "name": "laravel/boost", + "version": "v1.0.18", + "source": { + "type": "git", + "url": "https://github.com/laravel/boost.git", + "reference": "df2a62b5864759ea8cce8a4b7575b657e9c7d4ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/boost/zipball/df2a62b5864759ea8cce8a4b7575b657e9c7d4ab", + "reference": "df2a62b5864759ea8cce8a4b7575b657e9c7d4ab", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7.9", + "illuminate/console": "^10.0|^11.0|^12.0", + "illuminate/contracts": "^10.0|^11.0|^12.0", + "illuminate/routing": "^10.0|^11.0|^12.0", + "illuminate/support": "^10.0|^11.0|^12.0", + "laravel/mcp": "^0.1.0", + "laravel/prompts": "^0.1.9|^0.3", + "laravel/roster": "^0.2", + "php": "^8.1|^8.2" + }, + "require-dev": { + "laravel/pint": "^1.14|^1.23", + "mockery/mockery": "^1.6", + "orchestra/testbench": "^8.22.0|^9.0|^10.0", + "pestphp/pest": "^2.0|^3.0", + "phpstan/phpstan": "^2.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Boost\\BoostServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Boost\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Laravel Boost accelerates AI-assisted development to generate high-quality, Laravel-specific code.", + "homepage": "https://github.com/laravel/boost", + "keywords": [ + "ai", + "dev", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/boost/issues", + "source": "https://github.com/laravel/boost" + }, + "time": "2025-08-16T09:10:03+00:00" + }, + { + "name": "laravel/mcp", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/mcp.git", + "reference": "6d6284a491f07c74d34f48dfd999ed52c567c713" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/mcp/zipball/6d6284a491f07c74d34f48dfd999ed52c567c713", + "reference": "6d6284a491f07c74d34f48dfd999ed52c567c713", + "shasum": "" + }, + "require": { + "illuminate/console": "^10.0|^11.0|^12.0", + "illuminate/contracts": "^10.0|^11.0|^12.0", + "illuminate/http": "^10.0|^11.0|^12.0", + "illuminate/routing": "^10.0|^11.0|^12.0", + "illuminate/support": "^10.0|^11.0|^12.0", + "illuminate/validation": "^10.0|^11.0|^12.0", + "php": "^8.1|^8.2" + }, + "require-dev": { + "laravel/pint": "^1.14", + "orchestra/testbench": "^8.22.0|^9.0|^10.0", + "phpstan/phpstan": "^2.0" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Mcp": "Laravel\\Mcp\\Server\\Facades\\Mcp" + }, + "providers": [ + "Laravel\\Mcp\\Server\\McpServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Mcp\\": "src/", + "Workbench\\App\\": "workbench/app/", + "Laravel\\Mcp\\Tests\\": "tests/", + "Laravel\\Mcp\\Server\\": "src/Server/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The easiest way to add MCP servers to your Laravel app.", + "homepage": "https://github.com/laravel/mcp", + "keywords": [ + "dev", + "laravel", + "mcp" + ], + "support": { + "issues": "https://github.com/laravel/mcp/issues", + "source": "https://github.com/laravel/mcp" + }, + "time": "2025-08-16T09:50:43+00:00" + }, { "name": "laravel/pint", "version": "v1.24.0", @@ -9390,6 +9519,67 @@ }, "time": "2025-07-10T18:09:32+00:00" }, + { + "name": "laravel/roster", + "version": "v0.2.3", + "source": { + "type": "git", + "url": "https://github.com/laravel/roster.git", + "reference": "caeed7609b02c00c3f1efec52812d8d87c5d4096" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/roster/zipball/caeed7609b02c00c3f1efec52812d8d87c5d4096", + "reference": "caeed7609b02c00c3f1efec52812d8d87c5d4096", + "shasum": "" + }, + "require": { + "illuminate/console": "^10.0|^11.0|^12.0", + "illuminate/contracts": "^10.0|^11.0|^12.0", + "illuminate/routing": "^10.0|^11.0|^12.0", + "illuminate/support": "^10.0|^11.0|^12.0", + "php": "^8.1|^8.2", + "symfony/yaml": "^6.4|^7.2" + }, + "require-dev": { + "laravel/pint": "^1.14", + "mockery/mockery": "^1.6", + "orchestra/testbench": "^8.22.0|^9.0|^10.0", + "pestphp/pest": "^2.0|^3.0", + "phpstan/phpstan": "^2.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Roster\\RosterServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Roster\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Detect packages & approaches in use within a Laravel project", + "homepage": "https://github.com/laravel/roster", + "keywords": [ + "dev", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/roster/issues", + "source": "https://github.com/laravel/roster" + }, + "time": "2025-08-13T15:00:25+00:00" + }, { "name": "laravel/sail", "version": "v1.44.0", diff --git a/package-lock.json b/package-lock.json index 2d389cc3..62d165e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@fontsource/poppins": "^5.2.6", "@tailwindcss/forms": "^0.5.10", "@tailwindcss/typography": "^0.5.16", - "@tailwindcss/vite": "^4.1.11", + "@tailwindcss/vite": "^4.1.12", "alpinejs": "^3.14.9", "atropos": "^2.0.2", "axios": "^1.11.0", @@ -25,7 +25,7 @@ "prettier-plugin-blade": "^2.1.21", "prettier-plugin-tailwindcss": "^0.6.14", "tailwindcss": "^4.1.12", - "vite": "^7.1.2" + "vite": "^7.1.3" }, "engines": { "node": ">=20.19.0 || >=22.12.0" @@ -2738,14 +2738,14 @@ "license": "MIT" }, "node_modules/vite": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.2.tgz", - "integrity": "sha512-J0SQBPlQiEXAF7tajiH+rUooJPo0l8KQgyg4/aMunNtrOa7bwuZJsJbDWzeljqQpgftxuq5yNJxQ91O9ts29UQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.3.tgz", + "integrity": "sha512-OOUi5zjkDxYrKhTV3V7iKsoS37VUM7v40+HuwEmcrsf11Cdx9y3DIr2Px6liIcZFwt3XSRpQvFpL3WVy7ApkGw==", "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.25.0", - "fdir": "^6.4.6", + "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", diff --git a/package.json b/package.json index 25221401..e1a9b21a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "build": "vite build" }, "devDependencies": { - "@tailwindcss/vite": "^4.1.11", "@alpinejs/collapse": "^3.14.9", "@alpinejs/persist": "^3.14.9", "@alpinejs/resize": "^3.14.9", @@ -17,6 +16,7 @@ "@fontsource/poppins": "^5.2.6", "@tailwindcss/forms": "^0.5.10", "@tailwindcss/typography": "^0.5.16", + "@tailwindcss/vite": "^4.1.12", "alpinejs": "^3.14.9", "atropos": "^2.0.2", "axios": "^1.11.0", @@ -29,6 +29,6 @@ "prettier-plugin-blade": "^2.1.21", "prettier-plugin-tailwindcss": "^0.6.14", "tailwindcss": "^4.1.12", - "vite": "^7.1.2" + "vite": "^7.1.3" } } diff --git a/public/brand-assets/desktop/nativephp-desktop-for-dark-background.svg b/public/brand-assets/desktop/nativephp-desktop-for-dark-background.svg new file mode 100644 index 00000000..3782ecee --- /dev/null +++ b/public/brand-assets/desktop/nativephp-desktop-for-dark-background.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/brand-assets/desktop/nativephp-desktop-for-light-background.svg b/public/brand-assets/desktop/nativephp-desktop-for-light-background.svg new file mode 100644 index 00000000..1d82d9f0 --- /dev/null +++ b/public/brand-assets/desktop/nativephp-desktop-for-light-background.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/brand-assets/desktop/nativephp-desktop-in-grayscale.svg b/public/brand-assets/desktop/nativephp-desktop-in-grayscale.svg new file mode 100644 index 00000000..212e4511 --- /dev/null +++ b/public/brand-assets/desktop/nativephp-desktop-in-grayscale.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/brand-assets/logo/nativephp-for-dark-background.svg b/public/brand-assets/logo/nativephp-for-dark-background.svg new file mode 100644 index 00000000..c0945f18 --- /dev/null +++ b/public/brand-assets/logo/nativephp-for-dark-background.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/public/brand-assets/logo/nativephp-for-light-background.svg b/public/brand-assets/logo/nativephp-for-light-background.svg new file mode 100644 index 00000000..ea8fbc0a --- /dev/null +++ b/public/brand-assets/logo/nativephp-for-light-background.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/public/brand-assets/mobile/nativephp-mobile-for-dark-background.svg b/public/brand-assets/mobile/nativephp-mobile-for-dark-background.svg new file mode 100644 index 00000000..f463493e --- /dev/null +++ b/public/brand-assets/mobile/nativephp-mobile-for-dark-background.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/brand-assets/mobile/nativephp-mobile-for-light-background.svg b/public/brand-assets/mobile/nativephp-mobile-for-light-background.svg new file mode 100644 index 00000000..6a12164c --- /dev/null +++ b/public/brand-assets/mobile/nativephp-mobile-for-light-background.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/brand-assets/mobile/nativephp-mobile-in-grayscale.svg b/public/brand-assets/mobile/nativephp-mobile-in-grayscale.svg new file mode 100644 index 00000000..3a45cb11 --- /dev/null +++ b/public/brand-assets/mobile/nativephp-mobile-in-grayscale.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/css/app.css b/resources/css/app.css index affa26d8..c3788399 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -10,9 +10,17 @@ @custom-variant dark (&:where(.dark, .dark *)); @theme { + --breakpoint-3xs: 20rem; + --breakpoint-2xs: 25rem; + --breakpoint-xs: 28rem; + --color-mirage: #141624; --color-haiti: #16182c; --color-cloud: #2b2e53; + --color-snow-flurry-50: #e0ffcb; + --color-snow-flurry-100: #d1ffae; + --color-snow-flurry-200: #a2fd00; + --color-snow-flurry-300: #97ed00; --font-poppins: 'Poppins', Verdana, sans-serif; } diff --git a/resources/css/docsearch.css b/resources/css/docsearch.css index 51319229..12587e55 100644 --- a/resources/css/docsearch.css +++ b/resources/css/docsearch.css @@ -11,7 +11,7 @@ } .DocSearch-Button { - @apply m-0 flex items-center rounded-lg bg-gray-50 font-normal ring-1 ring-slate-600/40 transition duration-300 ease-out dark:bg-black/30; + @apply m-0 flex items-center rounded-full bg-gray-50/50 font-normal ring-1 ring-slate-600/30 transition duration-300 ease-out dark:bg-black/30; } .DocSearch-Button:hover { @@ -36,7 +36,7 @@ } .DocSearch-Button-Placeholder { - @apply px-1 text-sm text-black/60 transition duration-300 min-[520px]:pr-20 dark:text-white/60; + @apply px-1 text-sm text-black/60 transition duration-300 min-[520px]:pr-10 dark:text-white/60; } .DocSearch-Button-Keys { diff --git a/resources/images/home/iphone.webp b/resources/images/home/iphone.webp new file mode 100644 index 00000000..f0d0e09e Binary files /dev/null and b/resources/images/home/iphone.webp differ diff --git a/resources/images/home/laravel_welcome_dark.webp b/resources/images/home/laravel_welcome_dark.webp new file mode 100644 index 00000000..5d86ae04 Binary files /dev/null and b/resources/images/home/laravel_welcome_dark.webp differ diff --git a/resources/images/home/laravel_welcome_light.webp b/resources/images/home/laravel_welcome_light.webp new file mode 100644 index 00000000..5c588902 Binary files /dev/null and b/resources/images/home/laravel_welcome_light.webp differ diff --git a/resources/images/home/macbook.webp b/resources/images/home/macbook.webp new file mode 100644 index 00000000..6cf637bc Binary files /dev/null and b/resources/images/home/macbook.webp differ diff --git a/resources/images/home/video_introduction_thumbnail.webp b/resources/images/home/video_introduction_thumbnail.webp new file mode 100644 index 00000000..36229934 Binary files /dev/null and b/resources/images/home/video_introduction_thumbnail.webp differ diff --git a/resources/views/article.blade.php b/resources/views/article.blade.php index 3b917c5b..fd59875d 100644 --- a/resources/views/article.blade.php +++ b/resources/views/article.blade.php @@ -1,7 +1,7 @@ {{-- Hero --}}
diff --git a/resources/views/blog.blade.php b/resources/views/blog.blade.php index c88de472..36e511a9 100644 --- a/resources/views/blog.blade.php +++ b/resources/views/blog.blade.php @@ -1,7 +1,7 @@ {{-- Hero --}}
diff --git a/resources/views/brand.blade.php b/resources/views/brand.blade.php new file mode 100644 index 00000000..86088974 --- /dev/null +++ b/resources/views/brand.blade.php @@ -0,0 +1,204 @@ + + {{-- Hero Section --}} +
+ {{-- Decorative dashed grid background (pure CSS) --}} + + + {{-- Grid --}} + + + {{-- Header --}} +
+ {{-- Primary Heading --}} +

+ NativePHP brand assets +

+ + {{-- Introduction Description --}} +

+ This page provides assets and rules for using + + NativePHP + + visuals in articles, videos, open source projects, and community + content. + +
+
+ + Our name and logo are trademarks of + + + Bifrost Technology. + + Please use them respectfully and only in ways that reflect + + NativePHP + + accurately. +

+
+ + {{-- List --}} +
+ @php + $assets = [ + [ + 'src' => '/brand-assets/logo/nativephp-for-light-background.svg', + 'alt' => 'NativePHP logo', + 'download' => '/brand-assets/logo/nativephp-for-light-background.svg', + 'height' => 'h-8', + 'isDarkSurface' => false, + ], + [ + 'src' => '/brand-assets/logo/nativephp-for-dark-background.svg', + 'alt' => 'NativePHP logo', + 'download' => '/brand-assets/logo/nativephp-for-dark-background.svg', + 'height' => 'h-8', + 'isDarkSurface' => true, + ], + [ + 'src' => '/brand-assets/mobile/nativephp-mobile-for-light-background.svg', + 'alt' => 'NativePHP For Mobile logo', + 'download' => '/brand-assets/mobile/nativephp-mobile-for-light-background.svg', + 'height' => 'h-16', + 'isDarkSurface' => false, + ], + [ + 'src' => '/brand-assets/mobile/nativephp-mobile-for-dark-background.svg', + 'alt' => 'NativePHP For Mobile logo', + 'download' => '/brand-assets/mobile/nativephp-mobile-for-dark-background.svg', + 'height' => 'h-16', + 'isDarkSurface' => true, + ], + [ + 'src' => '/brand-assets/mobile/nativephp-mobile-in-grayscale.svg', + 'alt' => 'NativePHP For Mobile logo', + 'download' => '/brand-assets/mobile/nativephp-mobile-in-grayscale.svg', + 'height' => 'h-16', + 'isDarkSurface' => true, + ], + [ + 'src' => '/brand-assets/desktop/nativephp-desktop-for-light-background.svg', + 'alt' => 'NativePHP For Desktop logo', + 'download' => '/brand-assets/desktop/nativephp-desktop-for-light-background.svg', + 'height' => 'h-16', + 'isDarkSurface' => false, + ], + [ + 'src' => '/brand-assets/desktop/nativephp-desktop-for-dark-background.svg', + 'alt' => 'NativePHP For Desktop logo', + 'download' => '/brand-assets/desktop/nativephp-desktop-for-dark-background.svg', + 'height' => 'h-16', + 'isDarkSurface' => true, + ], + [ + 'src' => '/brand-assets/desktop/nativephp-desktop-in-grayscale.svg', + 'alt' => 'NativePHP For Desktop logo', + 'download' => '/brand-assets/desktop/nativephp-desktop-in-grayscale.svg', + 'height' => 'h-16', + 'isDarkSurface' => true, + ], + ]; + @endphp + + @foreach ($assets as $asset) + + @endforeach +
+
+
diff --git a/resources/views/components/alert-beta.blade.php b/resources/views/components/alert-beta.blade.php deleted file mode 100644 index 9a22b52a..00000000 --- a/resources/views/components/alert-beta.blade.php +++ /dev/null @@ -1,52 +0,0 @@ - diff --git a/resources/views/components/bifrost-banner.blade.php b/resources/views/components/bifrost-banner.blade.php index 8cdf0ffa..92edcd7c 100644 --- a/resources/views/components/bifrost-banner.blade.php +++ b/resources/views/components/bifrost-banner.blade.php @@ -53,7 +53,7 @@ class="flex items-center *:-mr-1 *:h-0.5 *:w-4 *:rotate-50 *:rounded-full *:bg-s {{-- Bifrost --}}
@@ -95,7 +95,8 @@ class="flex items-center justify-center gap-3 transition duration-200 ease-in-ou
- The fastest way to compile, sign and distribute your apps for every platform + The fastest way to compile, sign and distribute your apps for + every platform
diff --git a/resources/views/components/brand/asset-card.blade.php b/resources/views/components/brand/asset-card.blade.php new file mode 100644 index 00000000..f95400b4 --- /dev/null +++ b/resources/views/components/brand/asset-card.blade.php @@ -0,0 +1,43 @@ +@props([ + 'src' => '', + 'alt' => '', + 'downloadHref' => null, + 'height' => 'h-8', + 'isDarkSurface' => false, +]) + +@php + $downloadHref = $downloadHref ?? $src; + $containerClasses = [ + 'grid h-50 w-full place-items-center rounded-xl p-5 ring-1', + $isDarkSurface ? 'bg-gray-900 ring-gray-800' : 'bg-gray-100 ring-gray-300', + ]; +@endphp + +
+ {{-- Asset --}} +
+ {{ $alt }} +
+ + {{-- Download button --}} + + +
Download
+
+
diff --git a/resources/views/components/docs-layout.blade.php b/resources/views/components/docs-layout.blade.php index 471ba745..302ab755 100644 --- a/resources/views/components/docs-layout.blade.php +++ b/resources/views/components/docs-layout.blade.php @@ -1,22 +1,20 @@ {{-- Main container --}} -
+
{{-- Left sidebar --}} @if (! empty($sidebarLeft)) - + {{ $sidebarLeft }} - + @endif
{{-- Content --}}
{{-- Docs mobile menu --}} - + - + {{-- Main content --}}
{{ $slot }}
@@ -24,9 +22,9 @@ class="mx-auto flex w-full max-w-5xl grow items-start px-4 pt-1 xl:max-w-7xl 2xl {{-- Right sidebar --}} @if (! empty($sidebarRight)) - + {{ $sidebarRight }} - + @endif
diff --git a/resources/views/components/alert-v1-announcement.blade.php b/resources/views/components/docs/alert-v1-announcement.blade.php similarity index 100% rename from resources/views/components/alert-v1-announcement.blade.php rename to resources/views/components/docs/alert-v1-announcement.blade.php diff --git a/resources/views/components/flex-list-of-links.blade.php b/resources/views/components/docs/flex-list-of-links.blade.php similarity index 100% rename from resources/views/components/flex-list-of-links.blade.php rename to resources/views/components/docs/flex-list-of-links.blade.php diff --git a/resources/views/components/link-button.blade.php b/resources/views/components/docs/link-button.blade.php similarity index 100% rename from resources/views/components/link-button.blade.php rename to resources/views/components/docs/link-button.blade.php diff --git a/resources/views/components/link-subtle.blade.php b/resources/views/components/docs/link-subtle.blade.php similarity index 100% rename from resources/views/components/link-subtle.blade.php rename to resources/views/components/docs/link-subtle.blade.php diff --git a/resources/views/components/docs-menu.blade.php b/resources/views/components/docs/menu.blade.php similarity index 97% rename from resources/views/components/docs-menu.blade.php rename to resources/views/components/docs/menu.blade.php index 831220f9..2e2397f2 100644 --- a/resources/views/components/docs-menu.blade.php +++ b/resources/views/components/docs/menu.blade.php @@ -45,7 +45,7 @@ class="size-5.5" {{-- Platform switcher --}} - + {{-- Docs mobile menu --}} diff --git a/resources/views/components/mini-platform-switcher.blade.php b/resources/views/components/docs/mini-platform-switcher.blade.php similarity index 100% rename from resources/views/components/mini-platform-switcher.blade.php rename to resources/views/components/docs/mini-platform-switcher.blade.php diff --git a/resources/views/components/platform-switcher.blade.php b/resources/views/components/docs/platform-switcher.blade.php similarity index 100% rename from resources/views/components/platform-switcher.blade.php rename to resources/views/components/docs/platform-switcher.blade.php diff --git a/resources/views/components/separator.blade.php b/resources/views/components/docs/separator.blade.php similarity index 100% rename from resources/views/components/separator.blade.php rename to resources/views/components/docs/separator.blade.php diff --git a/resources/views/components/sidebar-left-navigation.blade.php b/resources/views/components/docs/sidebar-left-navigation.blade.php similarity index 87% rename from resources/views/components/sidebar-left-navigation.blade.php rename to resources/views/components/docs/sidebar-left-navigation.blade.php index c72542b4..4b5d299f 100644 --- a/resources/views/components/sidebar-left-navigation.blade.php +++ b/resources/views/components/docs/sidebar-left-navigation.blade.php @@ -2,7 +2,7 @@ class="sticky top-20 hidden max-h-[calc(100dvh-7rem)] w-[18rem] shrink-0 overflow-x-hidden overflow-y-auto pt-4 pr-3 lg:block" >
- +
diff --git a/resources/views/components/sidebar-right.blade.php b/resources/views/components/docs/sidebar-right.blade.php similarity index 100% rename from resources/views/components/sidebar-right.blade.php rename to resources/views/components/docs/sidebar-right.blade.php diff --git a/resources/views/components/toc-and-sponsors.blade.php b/resources/views/components/docs/toc-and-sponsors.blade.php similarity index 100% rename from resources/views/components/toc-and-sponsors.blade.php rename to resources/views/components/docs/toc-and-sponsors.blade.php diff --git a/resources/views/components/early-access-button.blade.php b/resources/views/components/early-access-button.blade.php deleted file mode 100644 index 602f981f..00000000 --- a/resources/views/components/early-access-button.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -class(['group -inline-block - text-sm bg-purple-500 border-purple-600 -dark:border-purple-500 dark:bg-purple-700 -hover:bg-purple-600 dark:hover:bg-purple-800 - px-4 py-1.5 - border rounded-md - font-medium - text-white - ']) }} href="{{route('early-adopter')}}"> -
- - - {{-- --}} - {{-- --}} - Soon on iOS! -
-
diff --git a/resources/views/components/footer.blade.php b/resources/views/components/footer.blade.php index 416e8c46..7227e4cb 100644 --- a/resources/views/components/footer.blade.php +++ b/resources/views/components/footer.blade.php @@ -1,5 +1,5 @@
+
+
diff --git a/resources/views/early-adopter.blade.php b/resources/views/pricing.blade.php similarity index 98% rename from resources/views/early-adopter.blade.php rename to resources/views/pricing.blade.php index 96c2ec1c..33074c95 100644 --- a/resources/views/early-adopter.blade.php +++ b/resources/views/pricing.blade.php @@ -1,7 +1,7 @@ {{-- Hero Section --}}
@@ -197,7 +197,7 @@ class="absolute -top-1/2 left-0 -z-20 h-60 w-full rounded-full bg-[#FBF2E7] blur {{-- Quick Instructions Section --}}
@@ -611,7 +611,7 @@ class="absolute inset-0 -z-10 h-full w-full object-cover" {{-- Ultra Section --}}
{{-- Plan Name --}}

Learn More @@ -672,7 +672,7 @@ class="mt-5 block w-full max-w-xs rounded-2xl bg-zinc-200 py-4 text-center text- {{-- FAQ Section --}}
{{-- Section Heading --}} diff --git a/resources/views/privacy-policy.blade.php b/resources/views/privacy-policy.blade.php index fd0dcf3a..79397924 100644 --- a/resources/views/privacy-policy.blade.php +++ b/resources/views/privacy-policy.blade.php @@ -1,13 +1,13 @@ {{-- Hero --}}
{{-- Blurred circle - Decorative --}} @@ -74,7 +74,7 @@ class="text-sm" }) } " - class="flex items-center pb-3 pt-3.5 will-change-transform" + class="flex items-center pt-3.5 pb-3 will-change-transform" aria-hidden="true" >

diff --git a/resources/views/terms-of-service.blade.php b/resources/views/terms-of-service.blade.php index 3a2a67af..e7cad05e 100644 --- a/resources/views/terms-of-service.blade.php +++ b/resources/views/terms-of-service.blade.php @@ -1,13 +1,13 @@ {{-- Hero --}}

{{-- Blurred circle - Decorative --}} @@ -74,7 +74,7 @@ class="text-sm" }) } " - class="flex items-center pb-3 pt-3.5 will-change-transform" + class="flex items-center pt-3.5 pb-3 will-change-transform" aria-hidden="true" >

diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index e28b4fb3..21c654fd 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -1,894 +1,13 @@ {{-- Hero --}} -

- {{-- Header --}} -
- {{-- Build --}} -

- Build - Native PHP Apps -

- {{-- Native --}} -
-

- Native -

+ - {{-- Blurred circle --}} - + {{-- Explainer --}} + - {{-- Star --}} -
- -
- - {{-- Glass shape --}} - - - {{-- Video introduction --}} - -
- {{-- PHP Apps --}} -

- PHP Apps -

- - {{-- Shiny line --}} - -
- - {{-- Simon talk for mobile --}} - - - {{-- Description --}} -

- Bring your - - PHP - - & - - Laravel - - skills to the world of - - desktop & mobile apps - - . - - Build cross-platform applications effortlessly—no extra tools, just - the stack you love. -

- - {{-- Call to Action Button --}} - -
+ {{-- Partners --}} + {{-- Marcel talk --}} -
-
- {{-- Left side --}} -
-
- Laracon US Talk -
-

- Where did this come from? -

- -

- Watch Marcel's original NativePHP talk from Laracon US 2023 - in Nashville. Minds were blown as he demonstrated how to use - Laravel to build cross-platform desktop applications. -

-
- - {{-- Right side --}} - -
-
- - {{-- Sponsors --}} -
-

- NativePHP Sponsors -

-
- {{-- Featured sponsors --}} -
- -
- -
-
- {{-- Corporate sponsors --}} -
-

- Corporate Sponsors -

-
- -
-
-
- -
+ diff --git a/routes/web.php b/routes/web.php index dadaa247..be31ca97 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,13 +23,15 @@ Route::redirect('/discord', 'https://discord.gg/X62tWNStZK'); Route::view('/', 'welcome')->name('welcome'); -Route::view('mobile', 'early-adopter')->name('early-adopter'); +Route::view('pricing', 'pricing')->name('pricing'); +Route::view('brand', 'brand')->name('brand'); +Route::redirect('mobile', 'pricing'); Route::view('laracon-us-2025-giveaway', 'laracon-us-2025-giveaway')->name('laracon-us-2025-giveaway'); -Route::redirect('ios', 'mobile'); -Route::redirect('t-shirt', 'mobile'); -Route::redirect('tshirt', 'mobile'); -Route::view('privacy-policy', 'privacy-policy'); -Route::view('terms-of-service', 'terms-of-service'); +Route::redirect('ios', 'pricing'); +Route::redirect('t-shirt', 'pricing'); +Route::redirect('tshirt', 'pricing'); +Route::view('privacy-policy', 'privacy-policy')->name('privacy-policy'); +Route::view('terms-of-service', 'terms-of-service')->name('terms-of-service'); Route::view('partners', 'partners')->name('partners'); Route::view('sponsor', 'sponsoring')->name('sponsoring'); diff --git a/tests/Feature/MobileRouteTest.php b/tests/Feature/MobileRouteTest.php index 1c0b9bb4..d04a858b 100644 --- a/tests/Feature/MobileRouteTest.php +++ b/tests/Feature/MobileRouteTest.php @@ -12,7 +12,7 @@ public function mobile_route_does_not_include_stripe_payment_links() { $this ->withoutVite() - ->get(route('early-adopter')) + ->get(route('pricing')) ->assertDontSee('buy.stripe.com'); } @@ -21,7 +21,7 @@ public function mobile_route_includes_mobile_pricing_livewire_component() { $this ->withoutVite() - ->get(route('early-adopter')) + ->get(route('pricing')) ->assertSeeLivewire('mobile-pricing'); } }