I am returning a PDOException saying I could not connect to the server and I cannot figure out why... I am Following PHPAccademy's guide on YouTube.
This is the code used to define the connection parameters
'db' => [
'driver' => 'mysql',
'host' => '107.170.30.229',
'name' => 'bsa',
'username' => 'root',
'password' => 'password',
'charset' => 'utf8',
'collation' => 'utf8mb4_general_ci',
'prefix' => ''
],
This is the code that is used to connect to the database
use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule;
$capsule->addConnection([
'driver' => $app->config->get('db.driver'),
'host' => $app->config->get('db.host'),
'database' => $app->config->get('db.name'),
'username' => $app->config->get('db.username'),
'password' => $app->config->get('db.password'),
'charset' => $app->config->get('db.charset'),
'collation' => $app->config->get('db.collation'),
'prefix' => $app->config->get('db.prefix'),
]);
$capsule->bootEloquent();