Check your config/database.php file
do you have these
'default' => env('DB_CONNECTION', 'sqlite'),
'sqlite' => [
'driver' => 'sqlite',
'database' => database_path('database.sqlite'),
'prefix' => '',
],
Hello there its me again :) other yet other problem. i just love laravel :D The course that it should take me 30 min its taking me 3 days :D but never the less right now i manage to migrate succesfully. my database name is database.sqlite and its insite the database folder in my project. After migrating i did php artisan tinker and added two rows into my database.
DB::table('cards')->insert(['title' => 'My Second Card', 'created_at' => new DateTime, 'updated_at' => new DateTime]); => true
DB::table('cards')->insert(['title' => 'My First Card', 'created_at' => new DateTime, 'updated_at' => new DateTime]); => true
and then when i run DB::table('cards')->get(); i get 2 rows from my table as you can see:
DB::table('cards')->get(); => Illuminate\Support\Collection {#663 all: [ {#672 +"id": "1", +"title": "My Second Card", +"created_at": "2017-01-12 13:14:31", +"updated_at": "2017-01-12 13:14:31", }, {#661 +"id": "2", +"title": "My First Card", +"created_at": "2017-01-12 13:15:03", +"updated_at": "2017-01-12 13:15:03", }, ], }
but when i try to open localhost:8000/cards from my browser i got this error:
2/2 QueryException in Connection.php line 770: Database (database) does not exist. (SQL: select * from "cards")
1/2 InvalidArgumentException in SQLiteConnector.php line 34: Database (database) does not exist.
i tried a few things and none of them works i even installed sudo apt-get install sqlitebrowser and open the database and saw the two rows i created with artisan tinker, but why it says it cant find my database and still im able to do php artisan migrate? makes no logic for me. what im missing? thanks
Check your config/database.php file
do you have these
'default' => env('DB_CONNECTION', 'sqlite'),
'sqlite' => [
'driver' => 'sqlite',
'database' => database_path('database.sqlite'),
'prefix' => '',
],
Please or to participate in this conversation.