Skip to content

Commit 8a28f40

Browse files
committed
fix: usage relative file path in ResourceAlreadyExistsException
1 parent df4196b commit 8a28f40

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/Exceptions/ResourceAlreadyExistsException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function __construct(
1212
) {
1313
$entity = $this->getEntity();
1414

15-
parent::__construct("Cannot create {$entity} cause it already exists. Remove /{$this->filePath} and run command again.");
15+
parent::__construct("Cannot create {$entity} cause it already exists. Remove {$this->filePath} and run command again.");
1616
}
1717

1818
protected function getEntity(): string

tests/FactoryGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testFactoryClassExists()
4646
{
4747
$this->assertExceptionThrew(
4848
className: ResourceAlreadyExistsException::class,
49-
message: 'Cannot create PostFactory cause it already exists. Remove /database/factories/PostFactory.php and run command again.',
49+
message: 'Cannot create PostFactory cause it already exists. Remove database/factories/PostFactory.php and run command again.',
5050
);
5151

5252
$this->mockFactoryGenerator(

tests/ModelGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testModelAlreadyExists()
3030

3131
$this->assertExceptionThrew(
3232
className: ResourceAlreadyExistsException::class,
33-
message: 'Cannot create Post cause it already exists. Remove /app/Models/Blog/Post.php and run command again.',
33+
message: 'Cannot create Post cause it already exists. Remove app/Models/Blog/Post.php and run command again.',
3434
);
3535

3636
app(ModelGenerator::class)

tests/NovaResourceGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testCreateNovaTestAlreadyExists()
6363

6464
$this->assertExceptionThrew(
6565
className: ResourceAlreadyExistsException::class,
66-
message: 'Cannot create PostResource cause it already exists. Remove /app/Nova/PostResource.php and run command again.',
66+
message: 'Cannot create PostResource cause it already exists. Remove app/Nova/PostResource.php and run command again.',
6767
);
6868

6969
app(NovaResourceGenerator::class)

tests/NovaTestGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testGenerateNovaTestAlreadyExists()
7272

7373
$this->assertExceptionThrew(
7474
className: ResourceAlreadyExistsException::class,
75-
message: "Cannot create NovaPostResourceTest cause it already exists. Remove /app/Nova/NovaPostResourceTest.php and run command again.",
75+
message: "Cannot create NovaPostResourceTest cause it already exists. Remove app/Nova/NovaPostResourceTest.php and run command again.",
7676
);
7777

7878
app(NovaTestGenerator::class)

tests/ResourceGeneratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function testResourceAlreadyExists()
2020

2121
$this->assertExceptionThrew(
2222
className: ResourceAlreadyExistsException::class,
23-
message: 'Cannot create PostResource cause it already exists. Remove /app/Http/Resources/PostResource.php and run command again.',
23+
message: 'Cannot create PostResource cause it already exists. Remove app/Http/Resources/PostResource.php and run command again.',
2424
);
2525

2626
app(ResourceGenerator::class)
@@ -37,7 +37,7 @@ public function testCollectionResourceAlreadyExists()
3737

3838
$this->assertExceptionThrew(
3939
className: ResourceAlreadyExistsException::class,
40-
message: 'Cannot create PostsCollectionResource cause it already exists. Remove /app/Http/Resources/PostsCollectionResource.php and run command again.',
40+
message: 'Cannot create PostsCollectionResource cause it already exists. Remove app/Http/Resources/PostsCollectionResource.php and run command again.',
4141
);
4242

4343
app(ResourceGenerator::class)

0 commit comments

Comments
 (0)