- Forums
- Linux Commands
- Laravel SQLite - Setup Run and install SQLite in Laravel Application As The Default Database
Follow these steps to install SQLite as the default database connection for your laravel project. [5278], Last Updated: Mon Jun 24, 2024
edw
Sun Dec 31, 2023
0 Comments
264 Visits
1. Open .env file and change to:
REMOVE:
DB_HOST
DB_PORT
DB_DATABASE
DB_USERNAME
DB_PASSWORD
2. Create an empty file called database.sqlite
$ touch database/database.sqlite
3. Open config/database.php and change the following line from mysql to sqlite
$ code config/database.php
'default' => env('DB_CONNECTION', 'sqlite'),
4. Migrate as needed
Recommended: Install SQLite Viewer VS Code Extension