Try localhost instead of 127.0.0.1 Also try stopping and restarting mysql. And clear your config.
php artisan config:clear
Im working in a mac, I have tried everything and still the error.
Note: ProductController.php works fine until trying to return database info.
This is my .env:
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=laravel5 DB_USERNAME=root DB_PASSWORD=''
This is my database.php 'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'laravel5'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''),
Can't find the error please help!
Please or to participate in this conversation.