Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cursor/rules/laravel-boost.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This application is a Laravel application and its main Laravel ecosystems packag
- laravel/sail (SAIL) - v1
- pestphp/pest (PEST) - v4
- phpunit/phpunit (PHPUNIT) - v12
- rector/rector (RECTOR) - v2
- @inertiajs/vue3 (INERTIA) - v2
- tailwindcss (TAILWINDCSS) - v4
- vue (VUE) - v3
Expand Down
22 changes: 22 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,25 @@ AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"


# API Throttling Settings
# Configure rate limiting for API endpoints to prevent abuse and ensure fair usage

# Default API throttling (general endpoints)
# Maximum number of requests allowed within the decay period
API_THROTTLE_MAX_ATTEMPTS=100
# Decay period in minutes for resetting the request counter
API_THROTTLE_DECAY_MINUTES=1

# Authentication API throttling (login, register, etc.)
# Maximum number of auth attempts allowed within the decay period
API_THROTTLE_AUTH_MAX_ATTEMPTS=5
# Decay period in minutes for resetting the auth attempt counter
API_THROTTLE_AUTH_DECAY_MINUTES=1

# Password reset API throttling
# Maximum number of password reset requests allowed within the decay period
API_THROTTLE_PASSWORD_RESET_MAX_ATTEMPTS=3
# Decay period in minutes for resetting the password reset counter
API_THROTTLE_PASSWORD_RESET_DECAY_MINUTES=15
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This application is a Laravel application and its main Laravel ecosystems packag
- laravel/sail (SAIL) - v1
- pestphp/pest (PEST) - v4
- phpunit/phpunit (PHPUNIT) - v12
- rector/rector (RECTOR) - v2
- @inertiajs/vue3 (INERTIA) - v2
- tailwindcss (TAILWINDCSS) - v4
- vue (VUE) - v3
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,30 @@ jobs:
with:
php-version: '8.4'

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Install Dependencies
run: |
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
npm install
pnpm install

- name: Run Pint
run: vendor/bin/pint

- name: Format Frontend
run: npm run format
run: pnpm run format

- name: Lint Frontend
run: npm run lint
run: pnpm run lint

# - name: Commit Changes
# uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
31 changes: 26 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches:
- develop
- main
- master
pull_request:
branches:
- develop
- main
- master

Comment on lines 5 to 12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

CI migrate step may be pointing at the wrong database

The new php artisan migrate --force step is where things can go sideways:

  • In CI, php artisan migrate will use .env, not the sqlite :memory: config from phpunit.xml. If .env.example is still MySQL‑by‑default, this step can blow up unless you’ve actually wired a DB service + secrets.
  • Your tests then run with Pest, which do honor phpunit.xml and use sqlite in memory, so you’re effectively migrating one DB and testing against a different one.

Consider one of these saner options:

  • Configure DB env vars in the workflow before running migrate so it uses the same sqlite connection as phpunit; or
  • Drop the global migrate step and rely on Laravel’s usual testing traits (RefreshDatabase, etc.) to handle migrations per test; or
  • Run php artisan migrate --env=testing --force and ensure config('database') for testing matches what phpunit uses.

Also, you’re doing full npm ci + npm run build for a PHP test job. If there are no JS/E2E tests in this workflow, that’s just burning minutes for fun. Split JS builds into their own workflow or job if you don’t need them here.

Also applies to: 49-50

🤖 Prompt for AI Agents
In .github/workflows/tests.yml around lines 5-12 (and also apply to lines
49-50), the CI job runs php artisan migrate which will pick up .env (likely
MySQL) while phpunit uses sqlite :memory:, and the job also runs npm build
unnecessarily; fix by (a) removing the global migrate step and relying on test
traits (RefreshDatabase) OR configuring DB env vars in the workflow before
migrate to point to the same sqlite in-memory connection phpunit uses OR run
migrate with --env=testing and ensure the testing database config matches
phpunit.xml, and (b) split out or remove npm ci + npm run build from this
PHP-only test job so JS builds run only in a dedicated job/workflow when needed.

jobs:
ci:
Expand All @@ -29,10 +29,28 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install Node Dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader
Expand All @@ -44,7 +62,10 @@ jobs:
run: php artisan key:generate

- name: Build Assets
run: npm run build
run: pnpm run build

- name: Run Migrations
run: php artisan migrate --force

- name: Tests
run: ./vendor/bin/pest
1 change: 1 addition & 0 deletions .junie/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This application is a Laravel application and its main Laravel ecosystems packag
- laravel/sail (SAIL) - v1
- pestphp/pest (PEST) - v4
- phpunit/phpunit (PHPUNIT) - v12
- rector/rector (RECTOR) - v2
- @inertiajs/vue3 (INERTIA) - v2
- tailwindcss (TAILWINDCSS) - v4
- vue (VUE) - v3
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This application is a Laravel application and its main Laravel ecosystems packag
- laravel/sail (SAIL) - v1
- pestphp/pest (PEST) - v4
- phpunit/phpunit (PHPUNIT) - v12
- rector/rector (RECTOR) - v2
- @inertiajs/vue3 (INERTIA) - v2
- tailwindcss (TAILWINDCSS) - v4
- vue (VUE) - v3
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This application is a Laravel application and its main Laravel ecosystems packag
- laravel/sail (SAIL) - v1
- pestphp/pest (PEST) - v4
- phpunit/phpunit (PHPUNIT) - v12
- rector/rector (RECTOR) - v2
- @inertiajs/vue3 (INERTIA) - v2
- tailwindcss (TAILWINDCSS) - v4
- vue (VUE) - v3
Expand Down
1 change: 1 addition & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This application is a Laravel application and its main Laravel ecosystems packag
- laravel/sail (SAIL) - v1
- pestphp/pest (PEST) - v4
- phpunit/phpunit (PHPUNIT) - v12
- rector/rector (RECTOR) - v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Why is this duplicated in 5+ AI config files?

You're adding the same Rector entry to GEMINI.md, .github/copilot-instructions.md, AGENTS.md, .junie/guidelines.md, AND .cursor/rules/laravel-boost.mdc. That's peak enterprise "let's copy-paste our way to consistency."

Also, composer.json declares driftingly/rector-laravel but you're documenting rector/rector — pick one source of truth and reference it, don't maintain parallel universes.

🤖 Prompt for AI Agents
In GEMINI.md around line 28, the Rector entry is duplicated across multiple
config/docs and also mismatches composer.json; remove the duplicated
"rector/rector (RECTOR) - v2" entry here (and audit
.github/copilot-instructions.md, AGENTS.md, .junie/guidelines.md,
.cursor/rules/laravel-boost.mdc) and replace all occurrences with a single
canonical reference that matches composer.json (use "driftingly/rector-laravel"
if that is the package declared) or point all files to one chosen
source-of-truth, keeping versioning and label consistent across every file.
Ensure only one authoritative doc mentions the package and update any
labels/versions to match the composer.json declaration.

- @inertiajs/vue3 (INERTIA) - v2
- tailwindcss (TAILWINDCSS) - v4
- vue (VUE) - v3
Expand Down
16 changes: 1 addition & 15 deletions app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,19 @@
namespace App\Actions\Fortify;

use App\Models\User;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\CreatesNewUsers;

class CreateNewUser implements CreatesNewUsers
{
use PasswordValidationRules;

/**
* Validate and create a newly registered user.
* Create a newly registered user.
*
* @param array<string, string> $input
*/
public function create(array $input): User
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => [
'required',
'string',
'email',
'max:255',
Rule::unique(User::class),
],
'password' => $this->passwordRules(),
])->validate();

return User::create([
'name' => $input['name'],
'email' => $input['email'],
Expand Down
Loading
Loading