Не забудьте изменить $ mySqlConnection, $ tableName, $ filedName :
public function index()
{
//to get all the value of oil_price
$mySqlConnection = 'CONNECTION_NAME';
$tableName = 'TABLE_NAME';
$filedName = 'FILED_NAME';
//to get all the oil_price(only) from the databse
$controlVariableOne = DB::connection($mySqlConnection)->table($tableName)
->select($filedName)
->get();
foreach ($controlVariableOne as $controlVariableOneKey => $controlVariableOneValue)
{
$allcontrolVariableOneValues [] = $controlVariableOneValue->$filedName;
}
$controlVariableTwo = DB::connection($mySqlConnection)->table($tableName)
->select($filedName)
->first()->$filedName;
dd('All the Values From Databse ', $allcontrolVariableOneValues, 'First From Databse ',$controlVariableTwo);
$viewShare = ['controlVariableOne','controlVariableTwo'];
return view('home', compact($viewShare));
}