Autowire database connection.

This commit is contained in:
Krzysztof Płaczek
2025-05-14 15:15:49 +02:00
parent f30304cbe9
commit 76d8b7d9cf
2 changed files with 2 additions and 5 deletions

View File

@@ -5,13 +5,10 @@ namespace Krzysiej\RyobiCrawler;
use Illuminate\Database\Capsule\Manager as Capsule;
class DatabaseFactory
{
public static function create(): Capsule
public static function create(Capsule $capsule): void
{
$capsule = new Capsule;
$capsule->addConnection(['driver' => 'sqlite', 'database' => __DIR__ . '/../database.sqlite']);
$capsule->setAsGlobal();
$capsule->bootEloquent();
return $capsule;
}
}