DX audit and fix (PHP) #8

Merged
Snider merged 1 commit from agent/dx-audit-and-fix--laravel-php-package into dev 2026-03-24 11:35:43 +00:00
10 changed files with 30 additions and 9 deletions

View file

@ -51,14 +51,14 @@ php artisan make:mod Blog --web # Web routes only
php artisan make:mod Blog --api # API routes only
# Testing
vendor/bin/pest # Run all tests
composer test # Run all tests (Pest)
vendor/bin/pest tests/Feature # Run feature tests only
vendor/bin/pest --filter="test name" # Run single test by name
vendor/bin/pest path/to/TestFile.php # Run single test file
# Code quality
composer lint # Fix code style (Pint)
vendor/bin/pint --dirty # Format changed files only
vendor/bin/pint # Format all files
```
## Module Structure
@ -82,7 +82,7 @@ app/Mod/Blog/
|---------|-----------|---------|
| `lthn/php` | `Core\` | Framework core, events, module discovery |
| `lthn/php-admin` | `Core\Admin\` | Admin panel, Livewire modals |
| `lthn/php-api` | `Core\Api\` | REST API, scopes, rate limiting, webhooks |
| `lthn/api` | `Core\Api\` | REST API, scopes, rate limiting, webhooks |
| `lthn/php-mcp` | `Core\Mcp\` | Model Context Protocol for AI agents |
## Testing

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Providers;
use Illuminate\Support\ServiceProvider;

View file

@ -1,5 +1,9 @@
<?php
declare(strict_types=1);
use Core\LifecycleEventProvider;
use Core\Website\Boot;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
@ -7,10 +11,10 @@ use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
->withProviders([
// Core PHP Framework
\Core\LifecycleEventProvider::class,
\Core\Website\Boot::class,
\Core\Front\Boot::class,
\Core\Mod\Boot::class,
LifecycleEventProvider::class,
Boot::class,
Core\Front\Boot::class,
Core\Mod\Boot::class,
])
->withRouting(
web: __DIR__.'/../routes/web.php',
@ -19,7 +23,7 @@ return Application::configure(basePath: dirname(__DIR__))
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
\Core\Front\Boot::middleware($middleware);
Core\Front\Boot::middleware($middleware);
})
->withExceptions(function (Exceptions $exceptions) {
//

View file

@ -1,5 +1,8 @@
<?php
declare(strict_types=1);
use App\Providers\AppServiceProvider;
return [
App\Providers\AppServiceProvider::class,
AppServiceProvider::class,
];

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
/*
|--------------------------------------------------------------------------

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders;
use Illuminate\Database\Seeder;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));

View file

@ -1,3 +1,5 @@
<?php
declare(strict_types=1);
// API routes are registered via Core modules

View file

@ -1,3 +1,5 @@
<?php
declare(strict_types=1);
// Console commands are registered via Core modules

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Support\Facades\Route;
Route::get('/', function () {