Skip to content

Commit 07e5d90

Browse files
committed
refactor(database): remove more resolve calls
1 parent 1a13661 commit 07e5d90

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

packages/database/src/IsDatabaseModel.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ public static function findById(string|int|PrimaryKey $id): static
6262
return self::resolve($id);
6363
}
6464

65-
/**
66-
* Finds a model instance by its ID.
67-
*/
68-
public static function resolve(string|int|PrimaryKey $id): static
69-
{
70-
return model(self::class)->resolve($id);
71-
}
72-
7365
/**
7466
* Gets a model instance by its ID, optionally loading the given relationships.
7567
*/

tests/Integration/Database/ModelsWithoutIdTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ public function test_relationship_methods_throw_for_models_without_id(): void
135135
$this->migrate(CreateMigrationsTable::class, CreateLogEntryMigration::class);
136136

137137
$this->expectException(ModelDidNotHavePrimaryColumn::class);
138-
$this->expectExceptionMessage('does not have a primary column defined, which is required for the `resolve` method');
138+
$this->expectExceptionMessage('does not have a primary column defined, which is required for the `findById` method');
139139

140-
model(LogEntry::class)->resolve(id: 1);
140+
model(LogEntry::class)->findById(id: 1);
141141
}
142142

143143
public function test_get_method_throws_for_models_without_id(): void

0 commit comments

Comments
 (0)