database.sqlite missing. Run docker compose
docker compose exec php-app php index.php app:migrate
to create it.'); } $capsule = new Capsule; $capsule->addConnection(['driver' => 'sqlite', 'database' => __DIR__ . '/database.sqlite']); $capsule->setAsGlobal(); $capsule->bootEloquent(); $loader = new FilesystemLoader(__DIR__ . '/src/templates'); $twig = new Environment($loader); if (isset($_GET['product_id'])) { $template = 'product.html.twig'; $product = Product::with('price')->find($_GET['product_id']); } if (isset($_GET['category'])) { $template = 'productList.html.twig'; $products = Product::with('price')->selectRaw('products.*')->fromRaw('products, json_each(products.categories)')->whereRaw('json_each.value = ?', [$_GET['category']]) ->orderByDesc('starred')->orderByDesc('created_by')->get(); } if (isset($_GET['search'])) { $template = 'productList.html.twig'; $products = Product::with('price') ->orWhere([['name', 'like', "%{$_GET['search']}%"]]) ->orWhere([['subTitle', 'like', "%{$_GET['search']}%"]])->get(); } if (isset($_GET['star'])) { Product::find($_GET['star'])->toggleStarred()->save(); header('Location: '.$_SERVER['HTTP_REFERER']); } if (empty($_GET)) { $template = 'productList.html.twig'; $products = Product::with('price')->orderByDesc('starred')->orderByDesc('created_by')->get(); } $twig->display($template, ['products' => $products ?? [], 'product' => $product ?? [], 'search' => $_GET['search'] ?? '']);