Skip to content

Commit 1ee6740

Browse files
committed
fix docs for new DatabaseConfig after #902
1 parent fbb0ff3 commit 1ee6740

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

app/Front/Docs/Content/framework/05-models.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ In order to connect to a database, you'll have to create a database config file:
7171
```php
7272
// app/Config/database.config.php
7373

74-
use Tempest\Database\DatabaseConfig;
74+
use Tempest\Database\Config\SQLiteConfig;
7575

76-
return new DatabaseConfig(
77-
connection: new SQLiteConnection(
78-
path: __DIR__ . '/../database.sqlite',
79-
),
76+
return new SQLiteConfig(
77+
path: __DIR__ . '/../database.sqlite',
8078
);
8179
```
8280

@@ -85,18 +83,15 @@ Tempest has three available database drivers: `{php}SQLiteDriver`, `{php}MySqlDr
8583
```php
8684
// app/Config/database.config.php
8785

88-
use Tempest\Database\DatabaseConfig;
89-
use Tempest\Database\Connections\MySqlConnection;
86+
use Tempest\Database\Config\MysqlConfig;
9087
use function Tempest\env;
9188

92-
return new DatabaseConfig(
93-
connection: new MySqlConnection(
94-
host: env('DB_HOST'),
95-
port: env('DB_PORT'),
96-
username: env('DB_USERNAME'),
97-
password: env('DB_PASSWORD'),
98-
database: env('DB_DATABASE'),
99-
),
89+
return new MysqlConfig(
90+
host: env('DB_HOST'),
91+
port: env('DB_PORT'),
92+
username: env('DB_USERNAME'),
93+
password: env('DB_PASSWORD'),
94+
database: env('DB_DATABASE'),
10095
);
10196
```
10297

0 commit comments

Comments
 (0)