I tried to connect PostgreSQL and laravel I can see all data on pgAdmin. But I can't connect the PostgreSQL on laravel project Please help me Thanks
.Env file
DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=gotmold
DB_USERNAME=postgres
DB_PASSWORD=Slack0206!
Controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
class CurlController extends Controller
{
public function index(){
}
public function view(){
$User = User::get()->count();
print_r($User);
}
}
I got this error I already cleared cache
Illuminate\Database\QueryException
could not find driver (SQL: select * from "users")
http://127.0.0.1:8000/view