Skip to content

Commit 01c8c27

Browse files
committed
refactor: create domain folder
1 parent 7897c64 commit 01c8c27

File tree

55 files changed

+135
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+135
-113
lines changed

app/Actions/Fortify/CreateNewUser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Actions\Fortify;
44

5-
use App\Models\User;
5+
use App\Domain\Users\Models\User;
66
use Illuminate\Support\Facades\Hash;
77
use Illuminate\Support\Facades\Validator;
88
use Laravel\Fortify\Contracts\CreatesNewUsers;
@@ -16,7 +16,7 @@ class CreateNewUser implements CreatesNewUsers
1616
* Validate and create a newly registered user.
1717
*
1818
* @param array $input
19-
* @return \App\Models\User
19+
* @return \App\Domain\Users\Models\User
2020
*/
2121
public function create(array $input)
2222
{

app/Actions/Notes/StoreNoteAction.php renamed to app/Domain/Notes/Actions/StoreNoteAction.php

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

3-
namespace App\Actions\Notes;
4-
5-
use App\Dtos\Notes\StoreNoteData;
6-
use App\Dtos\Subscriptions\SubscriptionRulesData;
7-
use App\Exceptions\NoteExceptions;
8-
use App\Exceptions\SubscriptionExceptions;
9-
use App\Models\Note;
10-
use App\Models\User;
3+
namespace App\Domain\Notes\Actions;
4+
5+
use App\Domain\Notes\Dtos\StoreNoteData;
6+
use App\Domain\Subscriptions\Dtos\SubscriptionRulesData;
7+
use App\Domain\Notes\Exceptions\NoteExceptions;
8+
use App\Domain\Notes\Models\Note;
9+
use App\Domain\Subscriptions\Exceptions\SubscriptionExceptions;
10+
use App\Domain\Users\Models\User;
1111

1212
class StoreNoteAction
1313
{

app/Actions/Notes/UpdateNoteAction.php renamed to app/Domain/Notes/Actions/UpdateNoteAction.php

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

3-
namespace App\Actions\Notes;
3+
namespace App\Domain\Notes\Actions;
44

5-
use App\Dtos\Notes\UpdateNoteData;
6-
use App\Models\Note;
5+
use App\Domain\Notes\Dtos\UpdateNoteData;
6+
use App\Domain\Notes\Models\Note;
77

88
class UpdateNoteAction
99
{

app/Dtos/Notes/StoreNoteData.php renamed to app/Domain/Notes/Dtos/StoreNoteData.php

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

3-
namespace App\Dtos\Notes;
3+
namespace App\Domain\Notes\Dtos;
44

55
use Illuminate\Foundation\Http\FormRequest;
66

app/Dtos/Notes/UpdateNoteData.php renamed to app/Domain/Notes/Dtos/UpdateNoteData.php

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

3-
namespace App\Dtos\Notes;
3+
namespace App\Domain\Notes\Dtos;
44

55
use Illuminate\Foundation\Http\FormRequest;
66

app/Exceptions/NoteExceptions.php renamed to app/Domain/Notes/Exceptions/NoteExceptions.php

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

3-
namespace App\Exceptions;
3+
namespace App\Domain\Notes\Exceptions;
44

55
use Exception;
66

app/Models/Note.php renamed to app/Domain/Notes/Models/Note.php

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

3-
namespace App\Models;
3+
namespace App\Domain\Notes\Models;
44

5-
use App\QueryBuilders\NoteQueryBuilder;
5+
use App\Domain\Users\Models\User;
6+
use App\Domain\Notes\QueryBuilders\NoteQueryBuilder;
67
use Database\Factories\NoteFactory;
8+
use Illuminate\Database\Eloquent\Factories\Factory;
79
use Illuminate\Database\Eloquent\Factories\HasFactory;
810
use Illuminate\Database\Eloquent\Model;
911
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -37,6 +39,11 @@ class Note extends Model
3739
'content'
3840
];
3941

42+
protected static function newFactory(): Factory
43+
{
44+
return NoteFactory::new();
45+
}
46+
4047
/**
4148
* @param Builder $query
4249
* @return NoteQueryBuilder<Note>

app/QueryBuilders/NoteQueryBuilder.php renamed to app/Domain/Notes/QueryBuilders/NoteQueryBuilder.php

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

3-
namespace App\QueryBuilders;
3+
namespace App\Domain\Notes\QueryBuilders;
44

5-
use App\Models\User;
5+
use App\Domain\Users\Models\User;
66
use Illuminate\Database\Eloquent\Builder;
77

88
class NoteQueryBuilder extends Builder

app/Dtos/Subscriptions/SubscriptionRulesData.php renamed to app/Domain/Subscriptions/Dtos/SubscriptionRulesData.php

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

3-
namespace App\Dtos\Subscriptions;
3+
namespace App\Domain\Subscriptions\Dtos;
44

55
class SubscriptionRulesData
66
{

app/Exceptions/SubscriptionExceptions.php renamed to app/Domain/Subscriptions/Exceptions/SubscriptionExceptions.php

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

3-
namespace App\Exceptions;
3+
namespace App\Domain\Subscriptions\Exceptions;
44

55
use Exception;
66

0 commit comments

Comments
 (0)