Thanks so much for the reply! It pointed me in the right direction, but now I'm having a different issue.
I've been trying to add my database like this in my extension:
Config::set("database.connections.myconnection", [
"driver" => "mysql",
"host" => "127.0.0.1",
"port" => "3306",
"database" => (md DB name),
"username" => (my BD username),
"password" => (my DB password),
"charset" => "utf8mb4",
"collation" => "utf8mb4_unicode_ci",
]);
and whenever this code runs (currently it is placed in the data
method in a class that extends AbstractListController
) I get the following error:
Notice: Trying to access array offset on value of type null in C:\xampp\htdocs\forums\vendor\illuminate\support\Facades\Facade.php on line 175
It gives no additional details so I'm pretty stuck here. I have tried connecting to the database using the same credentials that are in my code and it works.
The code around like 175 of Facade.php
looks like:
/**
* Resolve the facade root instance from the container.
*
* @param string|object $name
* @return mixed
*/
protected static function resolveFacadeInstance($name)
{
if (is_object($name)) {
return $name;
}
if (isset(static::$resolvedInstance[$name])) {
return static::$resolvedInstance[$name];
}
return static::$resolvedInstance[$name] = static::$app[$name];
}
Line 175 is the return
statement at the end of the method.