Skip to content

Commit 95d55dc

Browse files
author
Snider
committed
Merge pull request 'DX audit and fix (PHP)' (#8) from agent/dx-audit-and-fix--laravel-php-package into dev
Reviewed-on: https://forge.lthn.ai/core/php-template/pulls/8
2 parents b1f3278 + 9f0d421 commit 95d55dc

10 files changed

Lines changed: 30 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ php artisan make:mod Blog --web # Web routes only
5151
php artisan make:mod Blog --api # API routes only
5252

5353
# Testing
54-
vendor/bin/pest # Run all tests
54+
composer test # Run all tests (Pest)
5555
vendor/bin/pest tests/Feature # Run feature tests only
5656
vendor/bin/pest --filter="test name" # Run single test by name
5757
vendor/bin/pest path/to/TestFile.php # Run single test file
5858

5959
# Code quality
60+
composer lint # Fix code style (Pint)
6061
vendor/bin/pint --dirty # Format changed files only
61-
vendor/bin/pint # Format all files
6262
```
6363

6464
## Module Structure
@@ -82,7 +82,7 @@ app/Mod/Blog/
8282
|---------|-----------|---------|
8383
| `lthn/php` | `Core\` | Framework core, events, module discovery |
8484
| `lthn/php-admin` | `Core\Admin\` | Admin panel, Livewire modals |
85-
| `lthn/php-api` | `Core\Api\` | REST API, scopes, rate limiting, webhooks |
85+
| `lthn/api` | `Core\Api\` | REST API, scopes, rate limiting, webhooks |
8686
| `lthn/php-mcp` | `Core\Mcp\` | Model Context Protocol for AI agents |
8787

8888
## Testing

app/Providers/AppServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Providers;
46

57
use Illuminate\Support\ServiceProvider;

bootstrap/app.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
<?php
22

3+
declare(strict_types=1);
4+
5+
use Core\LifecycleEventProvider;
6+
use Core\Website\Boot;
37
use Illuminate\Foundation\Application;
48
use Illuminate\Foundation\Configuration\Exceptions;
59
use Illuminate\Foundation\Configuration\Middleware;
610

711
return Application::configure(basePath: dirname(__DIR__))
812
->withProviders([
913
// Core PHP Framework
10-
\Core\LifecycleEventProvider::class,
11-
\Core\Website\Boot::class,
12-
\Core\Front\Boot::class,
13-
\Core\Mod\Boot::class,
14+
LifecycleEventProvider::class,
15+
Boot::class,
16+
Core\Front\Boot::class,
17+
Core\Mod\Boot::class,
1418
])
1519
->withRouting(
1620
web: __DIR__.'/../routes/web.php',
@@ -19,7 +23,7 @@
1923
health: '/up',
2024
)
2125
->withMiddleware(function (Middleware $middleware) {
22-
\Core\Front\Boot::middleware($middleware);
26+
Core\Front\Boot::middleware($middleware);
2327
})
2428
->withExceptions(function (Exceptions $exceptions) {
2529
//

bootstrap/providers.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
declare(strict_types=1);
4+
use App\Providers\AppServiceProvider;
5+
36
return [
4-
App\Providers\AppServiceProvider::class,
7+
AppServiceProvider::class,
58
];

config/core.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
return [
46
/*
57
|--------------------------------------------------------------------------

database/seeders/DatabaseSeeder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Database\Seeders;
46

57
use Illuminate\Database\Seeder;

public/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Http\Request;
46

57
define('LARAVEL_START', microtime(true));

routes/api.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
// API routes are registered via Core modules

routes/console.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
// Console commands are registered via Core modules

routes/web.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Support\Facades\Route;
46

57
Route::get('/', function () {

0 commit comments

Comments
 (0)