Skip to content

Commit 2a8de89

Browse files
committed
refactor: remove app folder by moving User model and AppServiceProvider to modules
1 parent 8f22bc8 commit 2a8de89

File tree

12 files changed

+56
-93
lines changed

12 files changed

+56
-93
lines changed

.claude/rules/git-workflow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Follow conventional commits:
1616
|------|---------|
1717
| `feat` | New features |
1818
| `fix` | Bug fixes |
19-
| `refactor` | Code restructuring (no behavior change) |
19+
| `ref` | Code restructuring (no behavior change) |
2020
| `test` | Adding/updating tests |
2121
| `docs` | Documentation changes |
2222
| `chore` | Maintenance tasks |
@@ -28,7 +28,7 @@ Follow conventional commits:
2828
```
2929
feat: add user registration endpoint
3030
fix: prevent duplicate email registration
31-
refactor: extract email validation to value object
31+
ref: extract email validation to value object
3232
test: add integration tests for user repository
3333
```
3434

@@ -68,7 +68,7 @@ test: add integration tests for user repository
6868
```
6969
feat/user-registration
7070
fix/duplicate-email-bug
71-
refactor/extract-email-vo
71+
ref/extract-email-vo
7272
test/user-repository
7373
```
7474

app/Http/Controllers/Controller.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

app/Models/User.php

Lines changed: 0 additions & 49 deletions
This file was deleted.

app/Providers/AppServiceProvider.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

bootstrap/providers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

33
return [
4-
App\Providers\AppServiceProvider::class,
4+
Modules\Shared\Infrastructure\Provider\SharedServiceProvider::class,
55
Modules\User\Infrastructure\Provider\UserServiceProvider::class,
66
];

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
},
2424
"autoload": {
2525
"psr-4": {
26-
"App\\": "app/",
2726
"Modules\\": "modules/",
2827
"Database\\Factories\\": "database/factories/",
2928
"Database\\Seeders\\": "database/seeders/"
@@ -59,7 +58,7 @@
5958
"@lint",
6059
"@phpstan",
6160
"@php artisan config:clear --ansi",
62-
"@php artisan test"
61+
"./vendor/bin/phpunit"
6362
],
6463
"post-autoload-dump": [
6564
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",

config/auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
'providers' => [
6363
'users' => [
6464
'driver' => 'eloquent',
65-
'model' => env('AUTH_MODEL', App\Models\User::class),
65+
'model' => env('AUTH_MODEL', Modules\User\Infrastructure\Persistence\Eloquent\Model\UserModel::class),
6666
],
6767

6868
// 'users' => [

database/factories/UserFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
use Illuminate\Support\Str;
88

99
/**
10-
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
10+
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\Modules\User\Infrastructure\Persistence\Eloquent\Model\UserModel>
1111
*/
1212
class UserFactory extends Factory
1313
{
14+
protected $model = \Modules\User\Infrastructure\Persistence\Eloquent\Model\UserModel::class;
15+
1416
/**
1517
* The current password being used by the factory.
1618
*/

database/seeders/DatabaseSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Database\Seeders;
44

5-
use App\Models\User;
65
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
76
use Illuminate\Database\Seeder;
7+
use Modules\User\Infrastructure\Persistence\Eloquent\Model\UserModel as User;
88

99
class DatabaseSeeder extends Seeder
1010
{
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Modules\Shared\Infrastructure\Provider;
6+
7+
use Illuminate\Support\ServiceProvider;
8+
9+
final class SharedServiceProvider extends ServiceProvider
10+
{
11+
public function register(): void
12+
{
13+
//
14+
}
15+
16+
public function boot(): void
17+
{
18+
//
19+
}
20+
}

0 commit comments

Comments
 (0)