Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.4, 8.3]
laravel: [12.*, 11.*]
php: [8.5, 8.4, 8.3]
laravel: [13.*, 12.*, 11.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 12.*
testbench: 10.*
- laravel: 11.*
testbench: 9.*
- laravel: 13.*
testbench: 11.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
7 changes: 2 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ This is a Laravel package built on [spatie/laravel-package-tools](https://github

**Package registration** is handled entirely in `src/LaravelAgentRequestServiceProvider.php` via `configurePackage()`, which wires up:
- Config file: `config/agent-request.php` → published as `laravel-agent-request`
- Views: `resources/views/`
- Migration stub: `database/migrations/create_agent_request_table.php.stub` (registered as `create_laravel_agent_request_table`)
- Artisan command: `src/Commands/LaravelAgentRequestCommand.php`

**Facade** (`src/Facades/LaravelAgentRequest.php`) resolves to the main `LaravelAgentRequest` class.
- Request macros

**Testing** uses Pest with Orchestra Testbench. `tests/TestCase.php` bootstraps the service provider. Migrations in `getEnvironmentSetUp()` are commented out by default — uncomment and adapt when tests need DB access. The arch test in `tests/ArchTest.php` enforces no `dd`, `dump`, or `ray` in source.

**Compatibility matrix:** PHP 8.3/8.4, Laravel 11.*/12.*, tested on both Ubuntu and Windows.
**Compatibility matrix:** PHP 8.3/8.4/8.5, Laravel 11.*/12.*/13.*, tested on both Ubuntu and Windows.

**PHPStan** runs at level 5 over `src/`, `config/`, and `database/`.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"require": {
"php": "^8.3",
"spatie/laravel-package-tools": "^1.16",
"illuminate/contracts": "^11.0||^12.0",
"illuminate/http": "^11.0||^12.0",
"illuminate/support": "^11.0||^12.0"
"illuminate/contracts": "^11.0||^12.0||^13.0",
"illuminate/http": "^11.0||^12.0||^13.0",
"illuminate/support": "^11.0||^12.0||^13.0"
},
"require-dev": {
"laravel/pint": "^1.14",
"nunomaduro/collision": "^8.8",
"larastan/larastan": "^3.0",
"orchestra/testbench": "^10.0.0||^9.0.0",
"orchestra/testbench": "^11.0.0||^10.0.0||^9.0.0",
"pestphp/pest": "^4.0",
"pestphp/pest-plugin-arch": "^4.0",
"pestphp/pest-plugin-laravel": "^4.0",
Expand Down
19 changes: 19 additions & 0 deletions tests/Http/RequestMacrosTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use Illuminate\Http\Request;

it('registers the wantsMarkdown macro on Request', function () {
expect(Request::hasMacro('wantsMarkdown'))->toBeTrue();
});

it('registers the expectsMarkdown macro on Request', function () {
expect(Request::hasMacro('expectsMarkdown'))->toBeTrue();
});

it('registers the isAgent macro on Request', function () {
expect(Request::hasMacro('isAgent'))->toBeTrue();
});

it('registers the isAiAssistant macro on Request', function () {
expect(Request::hasMacro('isAiAssistant'))->toBeTrue();
});
6 changes: 0 additions & 6 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,5 @@ protected function getPackageProviders($app)
public function getEnvironmentSetUp($app)
{
config()->set('database.default', 'testing');

/*
foreach (\Illuminate\Support\Facades\File::allFiles(__DIR__ . '/../database/migrations') as $migration) {
(include $migration->getRealPath())->up();
}
*/
}
}