Level 8
Try running php artisan config:cache it looks like its not reading your .env
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Basically what it says in the title.
Input (command line)
>>> \App\Project::all();
Output
=> Illuminate\Database\Eloquent\Collection {#2911
all: [
App\Project {#2912
id: "1",
title: "A Project",
description: "Best project ever.",
created_at: "2018-11-13 03:29:55",
updated_at: "2018-11-13 03:29:55",
},
],
}
Code (browser)
public function index()
{
$projects = \App\Project::all();
return view('projects.index');
}
Error
Illuminate \ Database \ QueryException
could not find driver (SQL: select * from `projects`)
I have verified that the PHP versions/INI configuration files are the same (Google said that multiple installations of PHP could be the cause).
Extra Info.
PHP Version => 7.1.23
System => Linux Fedora x86_64
PDO support => enabled
PDO drivers => pgsql, sqlite
PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.20.1
SQLite3 support => enabled
SQLite3 module version => 7.1.23
Try running php artisan config:cache it looks like its not reading your .env
Please or to participate in this conversation.