I have created a database schema and now I need to transform it into code for a project in laravel. I installed filament panel and created a filament user for the admin login :
php artisan make:filament-user
now when I try to log in as admin in the login form I receive the above-mentioned error!
I’m using the project as a clone from gitlab and I use Ubuntu on Windows.
My .env file :
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:wBRsBCpS5bzoOA06ye1EIlPeQ8au9is1j3+XNNSj/j4=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
DB_DATABASE=./database/database.sqlite
DB_FOREIGN_KEYS=true
My .env.example file :
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=slite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
My .env.save file :
PP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:rxPvNOP34FnNUSw1s9k2+uXvGvQ8Q5Z5YZiTrnfUFwY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
and my database.php file :
'default' => env('DB_CONNECTION', 'sqlite'),
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
2
Answers
You can either do this
or
You need to insert the absolute path to the sqlite database.
https://laravel.com/docs/10.x/database#sqlite-configuration