I am following the Series Laravel 5 from scratch in Laracasts and I am, in specific, on the lesson "Fetching Data".
I created the database.sqlite file, I added some data from the tinker and was able to retrieve them in the console. Then, I try to replicate what the video does.
My cards controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests;
class CardsController extends Controller
{
public function index()
{
$cards = \DB::table('cards')->get();
return view('cards.index', compact('cards'));
}
}
However, when I try to load the /cards route I have the following error
InvalidArgumentException in SQLiteConnector.php line 34:
Database (homestead) does not exist.
This is my env
file
APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:P3ZgRMRkb2e8+x7S9rDLLB+bKJdR5Unpj8zXBUIHIZE=
APP_URL=http://localhost
DB_CONNECTION=sqlite
DB_FILE=database.sqlite
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Aucun commentaire:
Enregistrer un commentaire