Merge pull request 'DX audit and fix (PHP)' (#8) from agent/dx-audit-and-fix--laravel-php-package into dev

Reviewed-on: #8
This commit is contained in:
Snider 2026-03-24 11:35:43 +00:00
commit 95d55dc180
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 php artisan make:mod Blog --api # API routes only
# Testing # 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 tests/Feature # Run feature tests only
vendor/bin/pest --filter="test name" # Run single test by name vendor/bin/pest --filter="test name" # Run single test by name
vendor/bin/pest path/to/TestFile.php # Run single test file vendor/bin/pest path/to/TestFile.php # Run single test file
# Code quality # Code quality
composer lint # Fix code style (Pint)
vendor/bin/pint --dirty # Format changed files only vendor/bin/pint --dirty # Format changed files only
vendor/bin/pint # Format all files
``` ```
## Module Structure ## Module Structure
@ -82,7 +82,7 @@ app/Mod/Blog/
|---------|-----------|---------| |---------|-----------|---------|
| `lthn/php` | `Core\` | Framework core, events, module discovery | | `lthn/php` | `Core\` | Framework core, events, module discovery |
| `lthn/php-admin` | `Core\Admin\` | Admin panel, Livewire modals | | `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 | | `lthn/php-mcp` | `Core\Mcp\` | Model Context Protocol for AI agents |
## Testing ## Testing

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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