I am struggling to figure out how I can make a database query inside of a Laravel config file.
I currently use:
You have a raw SQL query, and you are inside the config file. The config file has to be parsed before Laravel connects to the database.
You can simply connect to the database in pure php and do the query.
Connecting and querying a database in pure php is explained here: https://www.w3schools.com/php/php_mysql_connect.asp
$conn = mysqli_connect($servername, $username, $password);
$result = $conn->query('select version() as version');
$row = $result->fetch_assoc();
echo $row["version"];
$conn->close();
This should do it.