<?php

declare(strict_types=1);

use Illuminate\Database\Capsule\Manager as Capsule;
use Cartalyst\Sentinel\Native\Facades\Sentinel;
use Cartalyst\Sentinel\Native\SentinelBootstrapper;

prepareSqliteDatabase('sqlite:' . __DIR__ . '/../database/app.sqlite');

$capsule = new Capsule();
$capsule->addConnection([
    'driver'   => 'sqlite',
    'database' => realpath(__DIR__ . '/../database/app.sqlite') ?: __DIR__ . '/../database/app.sqlite',
    'prefix'   => '',
]);
$capsule->setAsGlobal();
$capsule->bootEloquent();

$bootstrapper = new SentinelBootstrapper(__DIR__ . '/../config/sentinel.php');
Sentinel::instance($bootstrapper);
