1. Go to this page and download the library: Download xlited/laravel-d1 library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xlited / laravel-d1 example snippets
use XliteDev\LaravelD1\D1\D1Pdo;
use XliteDev\LaravelD1\D1\D1PdoStatement;
use XliteDev\LaravelD1\CloudflareD1Connector;
$pdo = new D1Pdo(
dsn: 'sqlite::memory:', // irrelevant
connector: new CloudflareD1Connector(
database: 'your_database_id',
token: 'your_api_token',
accountId: 'your_cf_account_id',
),
);